MediaWiki REL1_34
WikiCategoryPage.php
Go to the documentation of this file.
1<?php
27
35 public function hasViewableContent() {
36 if ( parent::hasViewableContent() ) {
37 return true;
38 } else {
39 $cat = Category::newFromTitle( $this->mTitle );
40 // If any of these are not 0, then has members
41 if ( $cat->getPageCount()
42 || $cat->getSubcatCount()
43 || $cat->getFileCount()
44 ) {
45 return true;
46 }
47 }
48 return false;
49 }
50
58 public function isHidden() {
59 $pageId = $this->getTitle()->getArticleID();
60 $pageProps = PageProps::getInstance()->getProperties( $this->getTitle(), 'hiddencat' );
61
62 return isset( $pageProps[$pageId] );
63 }
64
72 public function isExpectedUnusedCategory() {
73 $pageId = $this->getTitle()->getArticleID();
74 $pageProps = PageProps::getInstance()->getProperties( $this->getTitle(), 'expectunusedcategory' );
75
76 return isset( $pageProps[$pageId] );
77 }
78}
static getInstance()
Definition PageProps.php:66
Special handling for category pages.
isHidden()
Checks if a category is hidden.
isExpectedUnusedCategory()
Checks if a category is expected to be an unused category.
hasViewableContent()
Don't return a 404 for categories in use.
Class representing a MediaWiki article and history.
Definition WikiPage.php:47
getTitle()
Get the title object of the article.
Definition WikiPage.php:298