import v2.0.0.0_RC3 | 2012-07-01
https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
@ -16,7 +16,7 @@
|
||||
* @package Zend_Paginator
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: All.php 16215 2009-06-21 19:36:07Z thomas $
|
||||
* @version $Id: All.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -25,10 +25,10 @@
|
||||
require_once 'Zend/Paginator/ScrollingStyle/Interface.php';
|
||||
|
||||
/**
|
||||
* A scrolling style that returns every page in the collection.
|
||||
* Useful when it is necessary to make every page available at
|
||||
* A scrolling style that returns every page in the collection.
|
||||
* Useful when it is necessary to make every page available at
|
||||
* once--for example, when using a dropdown menu pagination control.
|
||||
*
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Paginator
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
@ -38,7 +38,7 @@ class Zend_Paginator_ScrollingStyle_All implements Zend_Paginator_ScrollingStyle
|
||||
{
|
||||
/**
|
||||
* Returns an array of all pages given a page number and range.
|
||||
*
|
||||
*
|
||||
* @param Zend_Paginator $paginator
|
||||
* @param integer $pageRange Unused
|
||||
* @return array
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_Paginator
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Elastic.php 16215 2009-06-21 19:36:07Z thomas $
|
||||
* @version $Id: Elastic.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -28,7 +28,7 @@ require_once 'Zend/Paginator/ScrollingStyle/Sliding.php';
|
||||
* A Google-like scrolling style. Incrementally expands the range to about
|
||||
* twice the given page range, then behaves like a slider. See the example
|
||||
* link.
|
||||
*
|
||||
*
|
||||
* @link http://www.google.com/search?q=Zend+Framework
|
||||
* @category Zend
|
||||
* @package Zend_Paginator
|
||||
@ -39,7 +39,7 @@ class Zend_Paginator_ScrollingStyle_Elastic extends Zend_Paginator_ScrollingStyl
|
||||
{
|
||||
/**
|
||||
* Returns an array of "local" pages given a page number and range.
|
||||
*
|
||||
*
|
||||
* @param Zend_Paginator $paginator
|
||||
* @param integer $pageRange Unused
|
||||
* @return array
|
||||
@ -54,8 +54,10 @@ class Zend_Paginator_ScrollingStyle_Elastic extends Zend_Paginator_ScrollingStyl
|
||||
|
||||
if ($originalPageRange + $pageNumber - 1 < $pageRange) {
|
||||
$pageRange = $originalPageRange + $pageNumber - 1;
|
||||
} else if ($originalPageRange + $pageNumber - 1 > count($paginator)) {
|
||||
$pageRange = $originalPageRange + count($paginator) - $pageNumber;
|
||||
}
|
||||
|
||||
|
||||
return parent::getPages($paginator, $pageRange);
|
||||
}
|
||||
}
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_Paginator
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Interface.php 16215 2009-06-21 19:36:07Z thomas $
|
||||
* @version $Id: Interface.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -29,7 +29,7 @@ interface Zend_Paginator_ScrollingStyle_Interface
|
||||
{
|
||||
/**
|
||||
* Returns an array of "local" pages given a page number and range.
|
||||
*
|
||||
*
|
||||
* @param Zend_Paginator $paginator
|
||||
* @param integer $pageRange (Optional) Page range
|
||||
* @return array
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_Paginator
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Jumping.php 16215 2009-06-21 19:36:07Z thomas $
|
||||
* @version $Id: Jumping.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -25,10 +25,10 @@
|
||||
require_once 'Zend/Paginator/ScrollingStyle/Interface.php';
|
||||
|
||||
/**
|
||||
* A scrolling style in which the cursor advances to the upper bound
|
||||
* of the page range, the page range "jumps" to the next section, and
|
||||
* A scrolling style in which the cursor advances to the upper bound
|
||||
* of the page range, the page range "jumps" to the next section, and
|
||||
* the cursor moves back to the beginning of the range.
|
||||
*
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Paginator
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
@ -38,7 +38,7 @@ class Zend_Paginator_ScrollingStyle_Jumping implements Zend_Paginator_ScrollingS
|
||||
{
|
||||
/**
|
||||
* Returns an array of "local" pages given a page number and range.
|
||||
*
|
||||
*
|
||||
* @param Zend_Paginator $paginator
|
||||
* @param integer $pageRange Unused
|
||||
* @return array
|
||||
@ -47,17 +47,17 @@ class Zend_Paginator_ScrollingStyle_Jumping implements Zend_Paginator_ScrollingS
|
||||
{
|
||||
$pageRange = $paginator->getPageRange();
|
||||
$pageNumber = $paginator->getCurrentPageNumber();
|
||||
|
||||
|
||||
$delta = $pageNumber % $pageRange;
|
||||
|
||||
|
||||
if ($delta == 0) {
|
||||
$delta = $pageRange;
|
||||
}
|
||||
|
||||
$offset = $pageNumber - $delta;
|
||||
$lowerBound = $offset + 1;
|
||||
$lowerBound = $offset + 1;
|
||||
$upperBound = $offset + $pageRange;
|
||||
|
||||
return $paginator->getPagesInRange($lowerBound, $upperBound);
|
||||
|
||||
return $paginator->getPagesInRange($lowerBound, $upperBound);
|
||||
}
|
||||
}
|
@ -16,7 +16,7 @@
|
||||
* @package Zend_Paginator
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Sliding.php 16215 2009-06-21 19:36:07Z thomas $
|
||||
* @version $Id: Sliding.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -25,9 +25,9 @@
|
||||
require_once 'Zend/Paginator/ScrollingStyle/Interface.php';
|
||||
|
||||
/**
|
||||
* A Yahoo! Search-like scrolling style. The cursor will advance to
|
||||
* the middle of the range, then remain there until the user reaches
|
||||
* the end of the page set, at which point it will continue on to
|
||||
* A Yahoo! Search-like scrolling style. The cursor will advance to
|
||||
* the middle of the range, then remain there until the user reaches
|
||||
* the end of the page set, at which point it will continue on to
|
||||
* the end of the range and the last page in the set.
|
||||
*
|
||||
* @link http://search.yahoo.com/search?p=Zend+Framework
|
||||
@ -40,7 +40,7 @@ class Zend_Paginator_ScrollingStyle_Sliding implements Zend_Paginator_ScrollingS
|
||||
{
|
||||
/**
|
||||
* Returns an array of "local" pages given a page number and range.
|
||||
*
|
||||
*
|
||||
* @param Zend_Paginator $paginator
|
||||
* @param integer $pageRange (Optional) Page range
|
||||
* @return array
|
||||
@ -53,23 +53,23 @@ class Zend_Paginator_ScrollingStyle_Sliding implements Zend_Paginator_ScrollingS
|
||||
|
||||
$pageNumber = $paginator->getCurrentPageNumber();
|
||||
$pageCount = count($paginator);
|
||||
|
||||
|
||||
if ($pageRange > $pageCount) {
|
||||
$pageRange = $pageCount;
|
||||
}
|
||||
|
||||
|
||||
$delta = ceil($pageRange / 2);
|
||||
|
||||
if ($pageNumber - $delta > $pageCount - $pageRange) {
|
||||
$lowerBound = $pageCount - $pageRange + 1;
|
||||
$upperBound = $pageCount;
|
||||
$upperBound = $pageCount;
|
||||
} else {
|
||||
if ($pageNumber - $delta < 0) {
|
||||
$delta = $pageNumber;
|
||||
}
|
||||
|
||||
|
||||
$offset = $pageNumber - $delta;
|
||||
$lowerBound = $offset + 1;
|
||||
$lowerBound = $offset + 1;
|
||||
$upperBound = $offset + $pageRange;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user