* Use local context instead of global variables
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 2 Oct 2011 16:30:59 +0000 (16:30 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 2 Oct 2011 16:30:59 +0000 (16:30 +0000)
* Call Linker methods statically

includes/specials/SpecialShortpages.php

index 3b78501..eee036f 100644 (file)
@@ -86,23 +86,22 @@ class ShortPagesPage extends QueryPage {
        }
 
        function formatResult( $skin, $result ) {
-               global $wgLang;
-               $dm = $wgLang->getDirMark();
+               $dm = $this->getLang()->getDirMark();
 
                $title = Title::makeTitle( $result->namespace, $result->title );
                if ( !$title ) {
                        return '<!-- Invalid title ' .  htmlspecialchars( "{$result->namespace}:{$result->title}" ). '-->';
                }
-               $hlink = $skin->linkKnown(
+               $hlink = Linker::linkKnown(
                        $title,
                        wfMsgHtml( 'hist' ),
                        array(),
                        array( 'action' => 'history' )
                );
                $plink = $this->isCached()
-                                       ? $skin->link( $title )
-                                       : $skin->linkKnown( $title );
-               $size = wfMessage( 'nbytes', $wgLang->formatNum( $result->value ) )->escaped();
+                                       ? Linker::link( $title )
+                                       : Linker::linkKnown( $title );
+               $size = $this->msg( 'nbytes' )->numParams( $result->value )->escaped();
 
                return $title->exists()
                                ? "({$hlink}) {$dm}{$plink} {$dm}[{$size}]"