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 ) {
* Returns the html limit # input box
* @param string The basic link to include in the href
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
* @param string The basic link to include in the href
* Writes the html for the pages counter, eg, Results 1-10 of x
$to_result =
$this->total;
$txt .=
sprintf(T_('Results %d - %d of %d'), $from_result, $to_result, $this->total);
* Writes the html for the leafs counter, eg, Page 1 of x
function writeLeafsCounter() {
* Writes the html links for pages, eg, previous, next, 1 2 3 ... x
* @param string The basic link to include in the href
// clean link - could be better filtered in rewrite
require_once(mamboCore::get('mosConfig_absolute_path').
'/includes/phpInputFilter/class.inputfilter.php');
$link =
trim( $iFilter->process( $link ) );
// Removing task breaks nagivation - temporarily removed for 4.6.2 release
// For more information, See FS#127
// $link = preg_replace("/(task.*?)&/i", "", $link);
$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;
$link .=
'&limit='.
$this->limit;
$page =
($this_page -
2) *
$this->limit;
$txt .=
'<a href="'.
sefRelToAbs( "$link&limitstart=0" ) .
'" class="pagenav" title="'.
T_('first page').
'"><< '.
T_('Start') .
'</a> ';
$txt .=
'<a href="'.
sefRelToAbs( "$link&limitstart=$page" ) .
'" class="pagenav" title="'.
T_('previous page').
'">< '.
T_('Previous') .
'</a> ';
$txt .=
'<span class="pagenav"><< '.
T_('Start') .
'</span> ';
$txt .=
'<span class="pagenav">< '.
T_('Previous') .
'</span> ';
for ($i=
$start_loop; $i <=
$stop_loop; $i++
) {
$page =
($i -
1) *
$this->limit;
$txt .=
'<span class="pagenav">'.
$i .
'</span> ';
$txt .=
'<a href="'.
sefRelToAbs( $link .
'&limitstart='.
$page ) .
'" class="pagenav"><strong>'.
$i .
'</strong></a> ';
if ($this_page <
$total_pages) {
$page =
$this_page *
$this->limit;
$end_page =
($total_pages-
1) *
$this->limit;
$txt .=
'<a href="'.
sefRelToAbs( $link .
'&limitstart='.
$page ) .
' " class="pagenav" title="'.
T_('next page').
'">'.
T_('Next') .
' ></a> ';
$txt .=
'<a href="'.
sefRelToAbs( $link .
'&limitstart='.
$end_page ) .
' " class="pagenav" title="'.
T_('end page').
'">'.
T_('End') .
' >></a>';
$txt .=
'<span class="pagenav">'.
T_('Next') .
' ></span> ';
$txt .=
'<span class="pagenav">'.
T_('End') .
' >></span>';
Documentation generated on Mon, 05 May 2008 16:21:42 +0400 by phpDocumentor 1.4.0