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 * @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
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.
26 public function hasViewableContent() {
27 if ( parent
::hasViewableContent() ) {
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()