
Public Member Functions | |
| __construct ($total, $limitstart, $limit) | |
| getPagesCounter () | |
| writePagesLinks ($link='') | |
Public Attributes | |
| $limitstart = null | |
| $limit = null | |
| $total = null | |
Protected Member Functions | |
| makeLimitSteps () | |
| fixLink ($link) | |
Definition at line 71 of file aliroPageNav.php.
| aliroAbstractPageNav::__construct | ( | $ | total, | |
| $ | limitstart, | |||
| $ | limit | |||
| ) |
Definition at line 76 of file aliroPageNav.php.
References $limit, $limitstart, and $total.
00076 { 00077 $this->total = max($total, 0); 00078 $this->limit = max($limit, 1); 00079 if ($this->limit > $this->total) $this->limitstart = '0'; 00080 else { 00081 while ($limitstart > $this->total) $limitstart -= $this->limit; 00082 $this->limitstart = ($limitstart > 0) ? $limitstart : '0'; 00083 } 00084 }
| aliroAbstractPageNav::makeLimitSteps | ( | ) | [protected] |
Definition at line 86 of file aliroPageNav.php.
References aliroHTML::getInstance().
Referenced by aliroUserPageNav::getLimitBox(), and aliroAdminPageNav::getLimitBox().
00086 { 00087 $steps = array ('5', '10', '15', '20', '25', '30', '50'); 00088 $alirohtml = aliroHTML::getInstance(); 00089 foreach ($steps as $step) $limits[] = $alirohtml->makeOption($step); 00090 return $limits; 00091 }
| aliroAbstractPageNav::fixLink | ( | $ | link | ) | [protected] |
Definition at line 94 of file aliroPageNav.php.
References $sef, and aliroSEF::getInstance().
00094 { 00095 if ($this->isAdmin) return $link; 00096 $sef = aliroSEF::getInstance(); 00097 return $sef->sefRelToAbs($link); 00098 }
| aliroAbstractPageNav::getPagesCounter | ( | ) |
The html for the pages counter, eg, Results 1-10 of x
Definition at line 103 of file aliroPageNav.php.
References T_().
Referenced by aliroAdminPageNav::getListFooter(), and aliroAdminPageNav::writePagesCounter().
00103 { 00104 $html = ''; 00105 $to_result = min ($this->limitstart + $this->limit, $this->total); 00106 if ($this->total) $html .= sprintf(T_("Results %d to %d of %d"), $this->limitstart+1, $to_result, $this->total); 00107 else $html .= T_('No records found.'); 00108 return $html; 00109 }
| aliroAbstractPageNav::writePagesLinks | ( | $ | link = '' |
) |
The html for the Start - Previous - numbers - Next - End links
Reimplemented in aliroAdminPageNav.
Definition at line 115 of file aliroPageNav.php.
References T_().
00115 { 00116 $html = ''; 00117 $total_pages = ceil( $this->total / $this->limit ); 00118 $this_page = ceil( ($this->limitstart+1) / $this->limit ); 00119 $start_loop = (floor(($this_page-1)/_ALIRO_PAGE_NAV_DISPLAY_PAGES))*_ALIRO_PAGE_NAV_DISPLAY_PAGES+1; 00120 $stop_loop = min($total_pages, $start_loop + _ALIRO_PAGE_NAV_DISPLAY_PAGES - 1); 00121 $link .= '&limit='. $this->limit; 00122 if ($this_page > 1) { 00123 $page = ($this_page - 2) * $this->limit; 00124 $html .= '<a href="'.$this->fixLink ($link.'&limitstart=0').'" class="pagenav" title="'.T_('first page').'"><< '. T_('Start') .'</a> '; 00125 $html .= '<a href="'.$this->fixLink ($link.'&limitstart='.$page).'" class="pagenav" title="'.T_('previous page').'">< '. T_('Previous') .'</a> '; 00126 } else { 00127 $html .= '<span class="pagenav"><< '. T_('Start') .'</span> '; 00128 $html .= '<span class="pagenav">< '. T_('Previous') .'</span> '; 00129 } 00130 for ($i=$start_loop; $i <= $stop_loop; $i++) { 00131 $page = ($i - 1) * $this->limit; 00132 if ($i == $this_page) $html .= '<span class="pagenav">'. $i .'</span> '; 00133 else $html .= '<a href="'.$this->fixLink ($link.'&limitstart='.$page).'" class="pagenav"><strong>'. $i .'</strong></a> '; 00134 } 00135 if ($this_page < $total_pages) { 00136 $page = $this_page * $this->limit; 00137 $end_page = ($total_pages-1) * $this->limit; 00138 $html .= '<a href="'.$this->fixLink ($link.'&limitstart='.$page).' " class="pagenav" title="'.T_('next page').'">'. T_('Next') .' ></a> '; 00139 $html .= '<a href="'.$this->fixLink ($link.'&limitstart='.$end_page).' " class="pagenav" title="'.T_('end page').'">'. T_('End') .' >></a>'; 00140 } else { 00141 $html .= '<span class="pagenav">'. T_('Next') .' ></span> '; 00142 $html .= '<span class="pagenav">'. T_('End') .' >></span>'; 00143 } 00144 return $html; 00145 }
| aliroAbstractPageNav::$limitstart = null |
| aliroAbstractPageNav::$limit = null |
| aliroAbstractPageNav::$total = null |
1.5.5