Source for file pageNavigation.php
Documentation is available at pageNavigation.php
* @author Mambo Foundation Inc see README.php
* @copyright Mambo Foundation Inc.
* See COPYRIGHT.php for copyright notices and details.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
* Mambo is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
* Page navigation support class
/** @var int The record number to start dislpaying from */
/** @var int Number of rows to display per page */
/** @var int Total number of rows */
function mosPageNav( $total, $limitstart, $limit ) {
* @return string The html for the limit # input box
for ($i=
5; $i <=
30; $i+=
5) {
// build the html select list
$html =
mosHTML::selectList( $limits, 'limit', 'class="inputbox" size="1" onchange="document.adminForm.submit();"',
'value', 'text', $this->limit );
$html .=
"\n<input type=\"hidden\" name=\"limitstart\" value=\"$this->limitstart\" />";
* Writes the html limit # input box
* @return string The html for the pages counter, eg, Results 1-10 of x
$to_result =
$this->total;
$html .=
sprintf(T_("Results %d to %d of %d"), $from_result, $to_result, $this->total);
$html .=
T_('No records found.');
* Writes the html for the pages counter, eg, Results 1-10 of x
* @return string The html links for pages, eg, previous, next, 1 2 3 ... x
$start_loop =
(floor(($this_page-
1)/
$displayed_pages))*
$displayed_pages+
1;
if ($start_loop +
$displayed_pages -
1 <
$total_pages) {
$stop_loop =
$start_loop +
$displayed_pages -
1;
$stop_loop =
$total_pages;
$page =
($this_page -
2) *
$this->limit;
$html .=
"\n<a href=\"#beg\" class=\"pagenav\" title=\"".
T_('first page').
"\" onclick=\"javascript: document.adminForm.limitstart.value=0; document.adminForm.submit();return false;\"><< ".
T_('Start').
"</a>";
$html .=
"\n<a href=\"#prev\" class=\"pagenav\" title=\"".
T_('previous page').
"\" onclick=\"javascript: document.adminForm.limitstart.value=$page; document.adminForm.submit();return false;\">< ".
T_('Previous').
"</a>";
$html .=
"\n<span class=\"pagenav\"><< ".
T_('Start').
"</span>";
$html .=
"\n<span class=\"pagenav\">< ".
T_('Previous').
"</span>";
for ($i=
$start_loop; $i <=
$stop_loop; $i++
) {
$page =
($i -
1) *
$this->limit;
$html .=
"\n<span class=\"pagenav\"> $i </span>";
$html .=
"\n<a href=\"#$i\" class=\"pagenav\" onclick=\"javascript: document.adminForm.limitstart.value=$page; document.adminForm.submit();return false;\"><strong>$i</strong></a>";
if ($this_page <
$total_pages) {
$page =
$this_page *
$this->limit;
$end_page =
($total_pages-
1) *
$this->limit;
$html .=
"\n<a href=\"#next\" class=\"pagenav\" title=\"".
T_('next page').
"\" onclick=\"javascript: document.adminForm.limitstart.value=$page; document.adminForm.submit();return false;\"> ".
T_('Next').
" ></a>";
$html .=
"\n<a href=\"#end\" class=\"pagenav\" title=\"".
T_('end page').
"\" onclick=\"javascript: document.adminForm.limitstart.value=$end_page; document.adminForm.submit();return false;\"> ".
T_('End').
" >></a>";
$html .=
"\n<span class=\"pagenav\">".
T_('Next').
" ></span>";
$html .=
"\n<span class=\"pagenav\">".
T_('End').
" >></span>";
$html =
'<table class="adminlist"><tr><th colspan="3">';
$html .=
'</th></tr><tr>';
$html .=
'<td nowrap="true" width="48%" align="right">'.
T_('Display #').
'</td>';
$html .=
'<td nowrap="true" width="48%" align="left">' .
$this->getPagesCounter() .
'</td>';
$html .=
'</tr></table>';
* @param int The row index
* @param int The row index
* @param string The task to fire
* @param string The alt text for the icon
function orderUpIcon( $i, $condition=
true, $task=
'orderup' ) {
if (($i >
0 ||
($i+
$this->limitstart >
0)) &&
$condition) {
return '<a href="#reorder" onClick="return listItemTask(\'cb'.
$i.
'\',\''.
$task.
'\')" title="'.
$alt.
'">
<img src="images/uparrow.png" width="12" height="12" border="0" alt="'.
$alt.
'">
* @param int The row index
* @param int The number of items in the list
* @param string The task to fire
* @param string The alt text for the icon
function orderDownIcon( $i, $n, $condition=
true, $task=
'orderdown' ) {
return '<a href="#reorder" onClick="return listItemTask(\'cb'.
$i.
'\',\''.
$task.
'\')" title="'.
$alt.
'">
<img src="images/downarrow.png" width="12" height="12" border="0" alt="'.
$alt.
'">
Documentation generated on Mon, 05 May 2008 16:21:43 +0400 by phpDocumentor 1.4.0