Mark userLink, userTalkLink, blockLink() and emailLink() as public static per CR...
[mediawiki.git] / includes / WikiCategoryPage.php
blob1bbc691d6a4428db632a827b6bf43fddc666a282
1 <?php
2 /**
3 * Special handling for category pages
4 */
5 class WikiCategoryPage extends WikiPage {
6 /**
7 * Constructor from a page id
8 * @param $id Int article ID to load
10 * @return WikiCategoryPage
12 public static function newFromID( $id ) {
13 $t = Title::newFromID( $id );
14 # @todo FIXME: Doesn't inherit right
15 return $t == null ? null : new self( $t );
16 # return $t == null ? null : new static( $t ); // PHP 5.3
19 /**
20 * Don't return a 404 for categories in use.
21 * In use defined as: either the actual page exists
22 * or the category currently has members.
24 * @return bool
26 public function hasViewableContent() {
27 if ( parent::hasViewableContent() ) {
28 return true;
29 } else {
30 $cat = Category::newFromTitle( $this->mTitle );
31 // If any of these are not 0, then has members
32 if ( $cat->getPageCount()
33 || $cat->getSubcatCount()
34 || $cat->getFileCount()
35 ) {
36 return true;
39 return false;