Index: trunk/phase3/includes/CategoryPage.php |
— | — | @@ -82,15 +82,48 @@ |
83 | 83 | } |
84 | 84 | |
85 | 85 | class CategoryViewer { |
86 | | - var $title, $limit, $from, $until, |
| 86 | + var $limit, $from, $until, |
87 | 87 | $articles, $articles_start_char, |
88 | 88 | $children, $children_start_char, |
89 | | - $showGallery, $gallery, |
90 | | - $imgsNoGalley, $imgsNoGallery_start_char, |
91 | | - $skin, $collation; |
92 | | - # Category object for this page |
| 89 | + $showGallery, $imgsNoGalley, |
| 90 | + $imgsNoGallery_start_char, |
| 91 | + $skin, $imgsNoGallery; |
| 92 | + |
| 93 | + /** |
| 94 | + * @var |
| 95 | + */ |
| 96 | + var $nextPage; |
| 97 | + |
| 98 | + /** |
| 99 | + * @var Array |
| 100 | + */ |
| 101 | + var $flip; |
| 102 | + |
| 103 | + /** |
| 104 | + * @var Title |
| 105 | + */ |
| 106 | + var $title; |
| 107 | + |
| 108 | + /** |
| 109 | + * @var Collation |
| 110 | + */ |
| 111 | + var $collation; |
| 112 | + |
| 113 | + /** |
| 114 | + * @var ImageGallery |
| 115 | + */ |
| 116 | + var $gallery; |
| 117 | + |
| 118 | + /** |
| 119 | + * Category object for this page |
| 120 | + * @var Category |
| 121 | + */ |
93 | 122 | private $cat; |
94 | | - # The original query array, to be used in generating paging links. |
| 123 | + |
| 124 | + /** |
| 125 | + * The original query array, to be used in generating paging links. |
| 126 | + * @var array |
| 127 | + */ |
95 | 128 | private $query; |
96 | 129 | |
97 | 130 | function __construct( $title, $from = '', $until = '', $query = array() ) { |
— | — | @@ -160,6 +193,9 @@ |
161 | 194 | } |
162 | 195 | } |
163 | 196 | |
| 197 | + /** |
| 198 | + * @return Skin |
| 199 | + */ |
164 | 200 | function getSkin() { |
165 | 201 | if ( !$this->skin ) { |
166 | 202 | global $wgUser; |
— | — | @@ -202,6 +238,9 @@ |
203 | 239 | * entry in the categorylinks table is Category:A, not A, which it SHOULD be. |
204 | 240 | * Workaround: If sortkey == "Category:".$title, than use $title for sorting, |
205 | 241 | * else use sortkey... |
| 242 | + * |
| 243 | + * @param Title $title |
| 244 | + * @param string $sortkey |
206 | 245 | */ |
207 | 246 | function getSubcategorySortChar( $title, $sortkey ) { |
208 | 247 | global $wgContLang; |
— | — | @@ -528,10 +567,8 @@ |
529 | 568 | static function shortList( $articles, $articles_start_char ) { |
530 | 569 | $r = '<h3>' . htmlspecialchars( $articles_start_char[0] ) . "</h3>\n"; |
531 | 570 | $r .= '<ul><li>' . $articles[0] . '</li>'; |
532 | | - for ( $index = 1; $index < count( $articles ); $index++ ) |
533 | | - { |
534 | | - if ( $articles_start_char[$index] != $articles_start_char[$index - 1] ) |
535 | | - { |
| 571 | + for ( $index = 1; $index < count( $articles ); $index++ ) { |
| 572 | + if ( $articles_start_char[$index] != $articles_start_char[$index - 1] ) { |
536 | 573 | $r .= "</ul><h3>" . htmlspecialchars( $articles_start_char[$index] ) . "</h3>\n<ul>"; |
537 | 574 | } |
538 | 575 | |
— | — | @@ -629,8 +666,7 @@ |
630 | 667 | } |
631 | 668 | |
632 | 669 | if ( $dbcnt == $rescnt || ( ( $rescnt == $this->limit || $fromOrUntil ) |
633 | | - && $dbcnt > $rescnt ) ) |
634 | | - { |
| 670 | + && $dbcnt > $rescnt ) ) { |
635 | 671 | # Case 1: seems sane. |
636 | 672 | $totalcnt = $dbcnt; |
637 | 673 | } elseif ( $rescnt < $this->limit && !$fromOrUntil ) { |
Index: trunk/phase3/includes/Category.php |
— | — | @@ -13,7 +13,10 @@ |
14 | 14 | /** Name of the category, normalized to DB-key form */ |
15 | 15 | private $mName = null; |
16 | 16 | private $mID = null; |
17 | | - /** Category page title */ |
| 17 | + /** |
| 18 | + * Category page title |
| 19 | + * @var Title |
| 20 | + */ |
18 | 21 | private $mTitle = null; |
19 | 22 | /** Counts of membership (cat_pages, cat_subcats, cat_files) */ |
20 | 23 | private $mPages = null, $mSubcats = null, $mFiles = null; |
— | — | @@ -100,7 +103,7 @@ |
101 | 104 | * Factory function. |
102 | 105 | * |
103 | 106 | * @param $title Title for the category page |
104 | | - * @return Mixed: category, or false on a totally invalid name |
| 107 | + * @return category|false on a totally invalid name |
105 | 108 | */ |
106 | 109 | public static function newFromTitle( $title ) { |
107 | 110 | $cat = new self(); |
— | — | @@ -129,7 +132,7 @@ |
130 | 133 | * @param $row result set row, must contain the cat_xxx fields. If the fields are null, |
131 | 134 | * the resulting Category object will represent an empty category if a title object |
132 | 135 | * was given. If the fields are null and no title was given, this method fails and returns false. |
133 | | - * @param $title optional title object for the category represented by the given row. |
| 136 | + * @param Title $title optional title object for the category represented by the given row. |
134 | 137 | * May be provided if it is already known, to avoid having to re-create a title object later. |
135 | 138 | * @return Category |
136 | 139 | */ |
— | — | @@ -182,7 +185,7 @@ |
183 | 186 | public function getFileCount() { return $this->getX( 'mFiles' ); } |
184 | 187 | |
185 | 188 | /** |
186 | | - * @return mixed The Title for this category, or false on failure. |
| 189 | + * @return Title|false Title for this category, or false on failure. |
187 | 190 | */ |
188 | 191 | public function getTitle() { |
189 | 192 | if ( $this->mTitle ) return $this->mTitle; |