X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Factions%2FInfoAction.php;h=bfba59a02c7fbef60fb72110290d773bc40799c0;hb=8c59f43b3342292a464db5df492e478b29a64aa5;hp=d0145034c81c5c308a599d2a472748c8c241e983;hpb=4077b57759756ecd0d25427ec9598feb28a28ac1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index d0145034c8..bfba59a02c 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -174,7 +174,7 @@ class InfoAction extends FormlessAction { * @param string $table The table that will be added to the content * @param string $name The name of the row * @param string $value The value of the row - * @param string $id The ID to use for the 'tr' element + * @param string|null $id The ID to use for the 'tr' element * @return string The table with the row added */ protected function addRow( $table, $name, $value, $id ) { @@ -264,6 +264,12 @@ class InfoAction extends FormlessAction { $this->msg( 'pageinfo-length' ), $lang->formatNum( $title->getLength() ) ]; + // Page namespace + $pageNamespace = $title->getNsText(); + if ( $pageNamespace ) { + $pageInfo['header-basic'][] = [ $this->msg( 'pageinfo-namespace' ), $pageNamespace ]; + } + // Page ID (number not localised, as it's a database ID) $pageInfo['header-basic'][] = [ $this->msg( 'pageinfo-article-id' ), $id ]; @@ -393,7 +399,7 @@ class InfoAction extends FormlessAction { } // Subpages of this page, if subpages are enabled for the current NS - if ( MWNamespace::hasSubpages( $title->getNamespace() ) ) { + if ( $services->getNamespaceInfo()->hasSubpages( $title->getNamespace() ) ) { $prefixIndex = SpecialPage::getTitleFor( 'Prefixindex', $title->getPrefixedText() . '/' ); $pageInfo['header-basic'][] = [ @@ -724,12 +730,13 @@ class InfoAction extends FormlessAction { protected function pageCounts( Page $page ) { $fname = __METHOD__; $config = $this->context->getConfig(); - $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); + $services = MediaWikiServices::getInstance(); + $cache = $services->getMainWANObjectCache(); return $cache->getWithSetCallback( self::getCacheKey( $cache, $page->getTitle(), $page->getLatest() ), WANObjectCache::TTL_WEEK, - function ( $oldValue, &$ttl, &$setOpts ) use ( $page, $config, $fname ) { + function ( $oldValue, &$ttl, &$setOpts ) use ( $page, $config, $fname, $services ) { global $wgActorTableSchemaMigrationStage; $title = $page->getTitle(); @@ -753,7 +760,7 @@ class InfoAction extends FormlessAction { $joins = []; } - $watchedItemStore = MediaWikiServices::getInstance()->getWatchedItemStore(); + $watchedItemStore = $services->getWatchedItemStore(); $result = []; $result['watchers'] = $watchedItemStore->countWatchers( $title ); @@ -818,7 +825,7 @@ class InfoAction extends FormlessAction { ); // Subpages (if enabled) - if ( MWNamespace::hasSubpages( $title->getNamespace() ) ) { + if ( $services->getNamespaceInfo()->hasSubpages( $title->getNamespace() ) ) { $conds = [ 'page_namespace' => $title->getNamespace() ]; $conds[] = 'page_title ' . $dbr->buildLike( $title->getDBkey() . '/', $dbr->anyString() );