
Public Member Functions | |
| getCurrentPage ($displacement=0) | |
| getLimit () | |
| setCollection ($collection) | |
| getCollection () | |
| getFirstNum () | |
| setFirstNum ($firstNum) | |
| getLastNum () | |
| setLastNum ($lastNum) | |
| getTotalNum () | |
| setTotalNum ($totalNum) | |
| isFirstPage () | |
| getLastPageNum () | |
| setLastPageNum ($lastPageNum) | |
| isLastPage () | |
| getPages () | |
| getPreviousPageUrl () | |
| getNextPageUrl () | |
| getLastPageUrl () | |
Protected Attributes | |
| $_showPerPage = false | |
| $lastPageNumber = 1 | |
| $_totalNum = 0 | |
| $_firstNum = 0 | |
| $_lastNum = 1 | |
Definition at line 36 of file Pager.php.
| getCollection | ( | ) |
| getCurrentPage | ( | $ | displacement = 0 |
) |
Definition at line 44 of file Pager.php.
00045 { 00046 if ($page = (int) $this->getRequest()->getParam($this->getPageVarName()) + $displacement) { 00047 if ($page > $this->getLastPageNum()) { 00048 return $this->getLastPageNum(); 00049 } 00050 return $page; 00051 } 00052 return 1; 00053 }
| getFirstNum | ( | ) |
| getLastNum | ( | ) |
| getLastPageNum | ( | ) |
| getLastPageUrl | ( | ) |
Reimplemented from Mage_Page_Block_Html_Pager.
Definition at line 174 of file Pager.php.
00175 { 00176 return $this->getPageUrl($this->getLastPageNum()); 00177 }
| getLimit | ( | ) |
Reimplemented from Mage_Page_Block_Html_Pager.
Definition at line 55 of file Pager.php.
00056 { 00057 $limits = $this->getAvailableLimit(); 00058 // if ($limit = $this->getRequest()->getParam($this->getLimitVarName())) { 00059 // if (isset($limits[$limit])) { 00060 // return $limit; 00061 // } 00062 // } 00063 $limits = array_keys($limits); 00064 return $limits[0]; 00065 }
| getNextPageUrl | ( | ) |
Reimplemented from Mage_Page_Block_Html_Pager.
Definition at line 169 of file Pager.php.
00170 { 00171 return $this->getPageUrl($this->getCurrentPage(+1)); 00172 }
| getPages | ( | ) |
Reimplemented from Mage_Page_Block_Html_Pager.
Definition at line 141 of file Pager.php.
00142 { 00143 $pages = array(); 00144 if ($this->getLastPageNum() <= $this->_displayPages) { 00145 $pages = range(1, $this->getLastPageNum()); 00146 } else { 00147 $half = ceil($this->_displayPages / 2); 00148 if ($this->getCurrentPage() >= $half && $this->getCurrentPage() <= $this->getLastPageNum() - $half) { 00149 $start = ($this->getCurrentPage() - $half) + 1; 00150 $finish = ($start + $this->_displayPages) - 1; 00151 } elseif ($this->getCurrentPage() < $half) { 00152 $start = 1; 00153 $finish = $this->_displayPages; 00154 } elseif ($this->getCurrentPage() > ($this->getLastPageNum() - $half)) { 00155 $finish = $this->getLastPageNum(); 00156 $start = $finish - $this->_displayPages + 1; 00157 } 00158 $pages = range($start, $finish); 00159 } 00160 00161 return $pages; 00162 }
| getPreviousPageUrl | ( | ) |
Reimplemented from Mage_Page_Block_Html_Pager.
Definition at line 164 of file Pager.php.
00165 { 00166 return $this->getPageUrl($this->getCurrentPage(-1)); 00167 }
| getTotalNum | ( | ) |
| isFirstPage | ( | ) |
Reimplemented from Mage_Page_Block_Html_Pager.
Definition at line 120 of file Pager.php.
00121 { 00122 return $this->getCurrentPage() == 1; 00123 }
| isLastPage | ( | ) |
Reimplemented from Mage_Page_Block_Html_Pager.
Definition at line 136 of file Pager.php.
00137 { 00138 return $this->getCurrentPage() >= $this->getLastPageNum(); 00139 }
| setCollection | ( | $ | collection | ) |
Reimplemented from Mage_Page_Block_Html_Pager.
Definition at line 67 of file Pager.php.
00068 { 00069 $this->_collection = $collection; 00070 // ->setCurPage($this->getCurrentPage()); 00071 // If not int - then not limit 00072 // if ((int) $this->getLimit()) { 00073 // $this->_collection->setPageSize($this->getLimit()); 00074 // } 00075 00076 return $this; 00077 }
| setFirstNum | ( | $ | firstNum | ) |
| setLastNum | ( | $ | lastNum | ) |
| setLastPageNum | ( | $ | lastPageNum | ) |
| setTotalNum | ( | $ | totalNum | ) |
$_showPerPage = false [protected] |
1.5.8