Esempio n. 1
0
 public function testGetsPagesInRangeForLastPage()
 {
     $this->_paginator->setCurrentPageNumber(11);
     $actual = $this->_scrollingStyle->getPages($this->_paginator);
     $expected = array_combine(range(7, 11), range(7, 11));
     $this->assertEquals($expected, $actual);
 }
Esempio n. 2
0
 /**
  * Returns an array of "local" pages given a page number and range.
  * 
  * @param  Zend_Paginator $paginator
  * @param  integer $pageRange Unused
  * @return array
  */
 public function getPages(Zend_Paginator $paginator, $pageRange = null)
 {
     $pageRange = $paginator->getPageRange();
     $pageNumber = $paginator->getCurrentPageNumber();
     $originalPageRange = $pageRange;
     $pageRange = $pageRange * 2 - 1;
     if ($originalPageRange + $pageNumber - 1 < $pageRange) {
         $pageRange = $originalPageRange + $pageNumber - 1;
     }
     return parent::getPages($paginator, $pageRange);
 }