Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Paginator / ScrollingStyle / Jumping.php
blob96e1079faccda051b2e9b9ecd80a40c65d6eeef6
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Paginator\ScrollingStyle;
12 use Zend\Paginator\Paginator;
14 /**
15 * A scrolling style in which the cursor advances to the upper bound
16 * of the page range, the page range "jumps" to the next section, and
17 * the cursor moves back to the beginning of the range.
19 class Jumping implements ScrollingStyleInterface
21 /**
22 * Returns an array of "local" pages given a page number and range.
24 * @param Paginator $paginator
25 * @param int $pageRange Unused
26 * @return array
28 public function getPages(Paginator $paginator, $pageRange = null)
30 $pageRange = $paginator->getPageRange();
31 $pageNumber = $paginator->getCurrentPageNumber();
33 $delta = $pageNumber % $pageRange;
35 if ($delta == 0) {
36 $delta = $pageRange;
39 $offset = $pageNumber - $delta;
40 $lowerBound = $offset + 1;
41 $upperBound = $offset + $pageRange;
43 return $paginator->getPagesInRange($lowerBound, $upperBound);