return new WikiCategoryPage( $title );
}
- /**
- * Constructor from a page id
- * @param int $id Article ID to load
- * @return CategoryPage|null
- */
- public static function newFromID( $id ) {
- $t = Title::newFromID( $id );
- # @todo FIXME: Doesn't inherit right
- return $t == null ? null : new self( $t );
- # return $t == null ? null : new static( $t ); // PHP 5.3
- }
-
function view() {
$request = $this->getContext()->getRequest();
$diff = $request->getVal( 'diff' );
return;
}
- if ( !Hooks::run( 'CategoryPageView', array( &$this ) ) ) {
+ if ( !Hooks::run( 'CategoryPageView', [ &$this ] ) ) {
return;
}
$title = $this->getTitle();
- if ( NS_CATEGORY == $title->getNamespace() ) {
+ if ( $title->inNamespace( NS_CATEGORY ) ) {
$this->openShowCategory();
}
parent::view();
- if ( NS_CATEGORY == $title->getNamespace() ) {
+ if ( $title->inNamespace( NS_CATEGORY ) ) {
$this->closeShowCategory();
}
}
$reqArray = $request->getValues();
- $from = $until = array();
- foreach ( array( 'page', 'subcat', 'file' ) as $type ) {
+ $from = $until = [];
+ foreach ( [ 'page', 'subcat', 'file' ] as $type ) {
$from[$type] = $request->getVal( "{$type}from", $oldFrom );
$until[$type] = $request->getVal( "{$type}until", $oldUntil );