~chroot64bit/zivios/gentoo-experimental

« back to all changes in this revision

Viewing changes to application/library/Zend/Paginator/ScrollingStyle/Elastic.php

  • Committer: Mustafa A. Hashmi
  • Date: 2008-12-04 13:32:21 UTC
  • Revision ID: mhashmi@zivios.org-20081204133221-0nd1trunwevijj38
Inclusion of new installation framework with ties to zend layout and dojo layout

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * Zend Framework
 
4
 *
 
5
 * LICENSE
 
6
 *
 
7
 * This source file is subject to the new BSD license that is bundled
 
8
 * with this package in the file LICENSE.txt.
 
9
 * It is also available through the world-wide-web at this URL:
 
10
 * http://framework.zend.com/license/new-bsd
 
11
 * If you did not receive a copy of the license and are unable to
 
12
 * obtain it through the world-wide-web, please send an email
 
13
 * to license@zend.com so we can send you a copy immediately.
 
14
 *
 
15
 * @category   Zend
 
16
 * @package    Zend_Paginator
 
17
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 
18
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 
19
 * @version    $Id: Elastic.php 10013 2008-07-09 21:08:06Z norm2782 $
 
20
 */
 
21
 
 
22
/**
 
23
 * @see Zend_Paginator_ScrollingStyle_Sliding
 
24
 */
 
25
require_once 'Zend/Paginator/ScrollingStyle/Sliding.php';
 
26
 
 
27
/**
 
28
 * A Google-like scrolling style.  Incrementally expands the range to about
 
29
 * twice the given page range, then behaves like a slider.  See the example
 
30
 * link.
 
31
 * 
 
32
 * @link       http://www.google.com/search?q=Zend+Framework
 
33
 * @category   Zend
 
34
 * @package    Zend_Paginator
 
35
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 
36
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 
37
 */
 
38
class Zend_Paginator_ScrollingStyle_Elastic extends Zend_Paginator_ScrollingStyle_Sliding
 
39
{
 
40
    /**
 
41
     * Returns an array of "local" pages given a page number and range.
 
42
     * 
 
43
     * @param  Zend_Paginator $paginator
 
44
     * @param  integer $pageRange Unused
 
45
     * @return array
 
46
     */
 
47
    public function getPages(Zend_Paginator $paginator, $pageRange = null)
 
48
    {
 
49
        $pageRange  = $paginator->getPageRange();
 
50
        $pageNumber = $paginator->getCurrentPageNumber();
 
51
 
 
52
        $originalPageRange = $pageRange;
 
53
        $pageRange         = $pageRange * 2 - 1;
 
54
 
 
55
        if ($originalPageRange + $pageNumber - 1 < $pageRange) {
 
56
            $pageRange = $originalPageRange + $pageNumber - 1;
 
57
        }
 
58
        
 
59
        return parent::getPages($paginator, $pageRange);
 
60
    }
 
61
}
 
 
b'\\ No newline at end of file'