Fix phpcs errors in includes/
[lhc/web/wiklou.git] / includes / actions / InfoAction.php
index f932a40..9e4a150 100644 (file)
@@ -114,7 +114,7 @@ class InfoAction extends FormlessAction {
                $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 ) {
@@ -290,7 +290,7 @@ class InfoAction extends FormlessAction {
 
                $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(
@@ -314,13 +314,6 @@ class InfoAction extends FormlessAction {
                        $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' ) ||
@@ -345,7 +338,11 @@ class InfoAction extends FormlessAction {
                                $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() ) )
@@ -393,7 +390,7 @@ class InfoAction extends FormlessAction {
                // 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 :(
@@ -637,24 +634,12 @@ class InfoAction extends FormlessAction {
         * @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',
@@ -761,8 +746,6 @@ class InfoAction extends FormlessAction {
                        __METHOD__
                );
 
-               wfProfileOut( __METHOD__ );
-
                return $result;
        }