$pageInfo = $this->pageInfo();
// Allow extensions to add additional information
- wfRunHooks( 'InfoAction', array( $this->getContext(), &$pageInfo ) );
+ Hooks::run( 'InfoAction', array( $this->getContext(), &$pageInfo ) );
// Render page information
foreach ( $pageInfo as $header => $infoTable ) {
$pageInfo['header-basic'][] = array( $langDisp,
Language::fetchLanguageName( $pageLang, $lang->getCode() )
- . ' ' . $this->msg( 'parentheses', $pageLang ) );
+ . ' ' . $this->msg( 'parentheses', $pageLang )->escaped() );
// Content model of the page
$pageInfo['header-basic'][] = array(
$this->msg( 'pageinfo-robot-policy' ), $this->msg( "pageinfo-robot-${policy['index']}" )
);
- if ( isset( $pageCounts['views'] ) ) {
- // Number of views
- $pageInfo['header-basic'][] = array(
- $this->msg( 'pageinfo-views' ), $lang->formatNum( $pageCounts['views'] )
- );
- }
-
$unwatchedPageThreshold = $config->get( 'UnwatchedPageThreshold' );
if (
$user->isAllowed( 'unwatchedpages' ) ||
$whatLinksHere,
$this->msg( 'pageinfo-redirects-name' )->escaped(),
array(),
- array( 'hidelinks' => 1, 'hidetrans' => 1 )
+ array(
+ 'hidelinks' => 1,
+ 'hidetrans' => 1,
+ 'hideimages' => $title->getNamespace() == NS_FILE
+ )
),
$this->msg( 'pageinfo-redirects-value' )
->numParams( count( $title->getRedirectsHere() ) )
// Page protection
$pageInfo['header-restrictions'] = array();
- // Is this page effected by the cascading protection of something which includes it?
+ // Is this page affected by the cascading protection of something which includes it?
if ( $title->isCascadeProtected() ) {
$cascadingFrom = '';
$sources = $title->getCascadeProtectionSources(); // Array deferencing is in PHP 5.4 :(
* @return array
*/
protected function pageCounts( Title $title ) {
- wfProfileIn( __METHOD__ );
$id = $title->getArticleID();
$config = $this->context->getConfig();
$dbr = wfGetDB( DB_SLAVE );
$result = array();
- if ( !$config->get( 'DisableCounters' ) ) {
- // Number of views
- $views = (int)$dbr->selectField(
- 'page',
- 'page_counter',
- array( 'page_id' => $id ),
- __METHOD__
- );
- $result['views'] = $views;
- }
-
// Number of page watchers
$watchers = (int)$dbr->selectField(
'watchlist',
__METHOD__
);
- wfProfileOut( __METHOD__ );
-
return $result;
}