* Use local context instead of global variables
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 28 Sep 2011 19:22:19 +0000 (19:22 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 28 Sep 2011 19:22:19 +0000 (19:22 +0000)
* Call Linker methods statically

includes/specials/SpecialPopularpages.php

index 7c7190a..74e6268 100644 (file)
@@ -36,6 +36,7 @@ class PopularPagesPage extends QueryPage {
                # page_counter is not indexed
                return true;
        }
+
        function isSyndicated() { return false; }
 
        function getQueryInfo() {
@@ -54,17 +55,13 @@ class PopularPagesPage extends QueryPage {
         * @return string
         */
        function formatResult( $skin, $result ) {
-               global $wgLang, $wgContLang;
+               global $wgContLang;
                $title = Title::makeTitle( $result->namespace, $result->title );
-               $link = $skin->linkKnown(
+               $link = Linker::linkKnown(
                        $title,
                        htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) )
                );
-               $nv = wfMsgExt(
-                       'nviews',
-                       array( 'parsemag', 'escape'),
-                       $wgLang->formatNum( $result->value )
-               );
-               return wfSpecialList($link, $nv);
+               $nv = $this->msg( 'nviews' )->numParams( $result->value )->escaped();
+               return wfSpecialList($link, $nv );
        }
 }