3 * Special handling for category pages
5 class WikiCategoryPage
extends WikiPage
{
7 * Constructor from a page id
8 * @param $id Int article ID to load
10 public static function newFromID( $id ) {
11 $t = Title
::newFromID( $id );
12 # @todo FIXME: Doesn't inherit right
13 return $t == null ?
null : new self( $t );
14 # return $t == null ? null : new static( $t ); // PHP 5.3
18 * Don't return a 404 for categories in use.
19 * In use defined as: either the actual page exists
20 * or the category currently has members.
22 public function hasViewableContent() {
23 if ( parent
::hasViewableContent() ) {
26 $cat = Category
::newFromTitle( $this->mTitle
);
27 // If any of these are not 0, then has members
28 if ( $cat->getPageCount()
29 ||
$cat->getSubcatCount()
30 ||
$cat->getFileCount()