~fusonic/chive/1.1

« back to all changes in this revision

Viewing changes to yii/web/widgets/pagers/CLinkPager.php

  • Committer: Matthias Burtscher
  • Date: 2010-02-12 09:12:35 UTC
  • Revision ID: matthias.burtscher@fusonic.net-20100212091235-jqxrb62klx872ajc
* Updated Yii to 1.1.0
* Removed CodePress and CodeMirror
* Updated jQuery and some plugins
* Cleaned some code ...

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *
5
5
 * @author Qiang Xue <qiang.xue@gmail.com>
6
6
 * @link http://www.yiiframework.com/
7
 
 * @copyright Copyright &copy; 2008-2009 Yii Software LLC
 
7
 * @copyright Copyright &copy; 2008-2010 Yii Software LLC
8
8
 * @license http://www.yiiframework.com/license/
9
9
 */
10
10
 
12
12
 * CLinkPager displays a list of hyperlinks that lead to different pages of target.
13
13
 *
14
14
 * @author Qiang Xue <qiang.xue@gmail.com>
15
 
 * @version $Id: CLinkPager.php 1035 2009-05-20 13:11:46Z qiang.xue $
 
15
 * @version $Id: CLinkPager.php 1678 2010-01-07 21:02:00Z qiang.xue $
16
16
 * @package system.web.widgets.pagers
17
17
 * @since 1.0
18
18
 */
66
66
         */
67
67
        public $htmlOptions=array();
68
68
 
69
 
 
70
69
        /**
71
 
         * Executes the widget.
72
 
         * This overrides the parent implementation by displaying the generated page buttons.
 
70
         * Initializes the pager by setting some default property values.
73
71
         */
74
 
        public function run()
 
72
        public function init()
75
73
        {
76
74
                if($this->nextPageLabel===null)
77
75
                        $this->nextPageLabel=Yii::t('yii','Next &gt;');
84
82
                if($this->header===null)
85
83
                        $this->header=Yii::t('yii','Go to page: ');
86
84
 
 
85
                if(!isset($this->htmlOptions['id']))
 
86
                        $this->htmlOptions['id']=$this->getId();
 
87
                if(!isset($this->htmlOptions['class']))
 
88
                        $this->htmlOptions['class']='yiiPager';
 
89
        }
 
90
 
 
91
        /**
 
92
         * Executes the widget.
 
93
         * This overrides the parent implementation by displaying the generated page buttons.
 
94
         */
 
95
        public function run()
 
96
        {
87
97
                $buttons=$this->createPageButtons();
88
 
 
89
98
                if(empty($buttons))
90
99
                        return;
91
 
 
92
100
                $this->registerClientScript();
93
 
 
94
 
                $htmlOptions=$this->htmlOptions;
95
 
                if(!isset($htmlOptions['id']))
96
 
                        $htmlOptions['id']=$this->getId();
97
 
                if(!isset($htmlOptions['class']))
98
 
                        $htmlOptions['class']='yiiPager';
99
101
                echo $this->header;
100
 
                echo CHtml::tag('ul',$htmlOptions,implode("\n",$buttons));
 
102
                echo CHtml::tag('ul',$this->htmlOptions,implode("\n",$buttons));
101
103
                echo $this->footer;
102
104
        }
103
105