http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90517

Revision: 90517
Author:   robin
Date:     2011-06-21 10:14:34 +0000 (Tue, 21 Jun 2011)
Log Message:
-----------
* Improvements as part of bug 6100: Use wfUILang() instead of $wgContLang where 
appropriate
* Remove $wgContLang in SpecialVersion per r90302

Modified Paths:
--------------
    trunk/phase3/includes/GlobalFunctions.php
    trunk/phase3/includes/LogEventsList.php
    trunk/phase3/includes/specials/SpecialBrokenRedirects.php
    trunk/phase3/includes/specials/SpecialContributions.php
    trunk/phase3/includes/specials/SpecialDisambiguations.php
    trunk/phase3/includes/specials/SpecialDoubleRedirects.php
    trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php
    trunk/phase3/includes/specials/SpecialListredirects.php
    trunk/phase3/includes/specials/SpecialNewpages.php
    trunk/phase3/includes/specials/SpecialProtectedpages.php
    trunk/phase3/includes/specials/SpecialShortpages.php
    trunk/phase3/includes/specials/SpecialVersion.php

Modified: trunk/phase3/includes/GlobalFunctions.php
===================================================================
--- trunk/phase3/includes/GlobalFunctions.php   2011-06-21 10:13:49 UTC (rev 
90516)
+++ trunk/phase3/includes/GlobalFunctions.php   2011-06-21 10:14:34 UTC (rev 
90517)
@@ -2522,8 +2522,7 @@
 }
 
 function wfSpecialList( $page, $details ) {
-       global $wgContLang;
-       $details = $details ? ' ' . $wgContLang->getDirMark() . "($details)" : 
'';
+       $details = $details ? ' ' . wfUILang()->getDirMark() . "($details)" : 
'';
        return $page . $details;
 }
 

Modified: trunk/phase3/includes/LogEventsList.php
===================================================================
--- trunk/phase3/includes/LogEventsList.php     2011-06-21 10:13:49 UTC (rev 
90516)
+++ trunk/phase3/includes/LogEventsList.php     2011-06-21 10:14:34 UTC (rev 
90517)
@@ -364,12 +364,11 @@
        }
 
        private function logComment( $row ) {
-               global $wgContLang;
                if( self::isDeleted( $row, LogPage::DELETED_COMMENT ) ) {
                        $comment = '<span class="history-deleted">' .
                                wfMsgHtml( 'rev-deleted-comment' ) . '</span>';
                } else {
-                       $comment = $wgContLang->getDirMark() .
+                       $comment = wfUILang()->getDirMark() .
                                $this->skin->commentBlock( $row->log_comment );
                }
                return $comment;

Modified: trunk/phase3/includes/specials/SpecialBrokenRedirects.php
===================================================================
--- trunk/phase3/includes/specials/SpecialBrokenRedirects.php   2011-06-21 
10:13:49 UTC (rev 90516)
+++ trunk/phase3/includes/specials/SpecialBrokenRedirects.php   2011-06-21 
10:14:34 UTC (rev 90517)
@@ -77,7 +77,7 @@
         * @return String
         */
        function formatResult( $skin, $result ) {
-               global $wgUser, $wgContLang, $wgLang;
+               global $wgUser, $wgLang;
 
                $fromObj = Title::makeTitle( $result->namespace, $result->title 
);
                if ( isset( $result->rd_title ) ) {
@@ -116,7 +116,7 @@
                        array(),
                        array( 'broken' )
                );
-               $arr = $wgContLang->getArrow();
+               $arr = wfUILang()->getArrow();
 
                $out = $from . wfMsg( 'word-separator' );
 

Modified: trunk/phase3/includes/specials/SpecialContributions.php
===================================================================
--- trunk/phase3/includes/specials/SpecialContributions.php     2011-06-21 
10:13:49 UTC (rev 90516)
+++ trunk/phase3/includes/specials/SpecialContributions.php     2011-06-21 
10:14:34 UTC (rev 90517)
@@ -543,7 +543,7 @@
         * @todo This would probably look a lot nicer in a table.
         */
        function formatRow( $row ) {
-               global $wgUser, $wgLang, $wgContLang;
+               global $wgUser, $wgLang;
                wfProfileIn( __METHOD__ );
 
                $sk = $this->getSkin();
@@ -590,7 +590,7 @@
                        array( 'action' => 'history' )
                );
 
-               $comment = $wgContLang->getDirMark() . $sk->revComment( $rev, 
false, true );
+               $comment = wfUILang()->getDirMark() . $sk->revComment( $rev, 
false, true );
                $date = $wgLang->timeanddate( wfTimestamp( TS_MW, 
$row->rev_timestamp ), true );
                if( $rev->userCan( Revision::DELETED_TEXT ) ) {
                        $d = $sk->linkKnown(

Modified: trunk/phase3/includes/specials/SpecialDisambiguations.php
===================================================================
--- trunk/phase3/includes/specials/SpecialDisambiguations.php   2011-06-21 
10:13:49 UTC (rev 90516)
+++ trunk/phase3/includes/specials/SpecialDisambiguations.php   2011-06-21 
10:14:34 UTC (rev 90517)
@@ -122,14 +122,13 @@
        }
 
        function formatResult( $skin, $result ) {
-               global $wgContLang;
                $title = Title::newFromID( $result->value );
                $dp = Title::makeTitle( $result->namespace, $result->title );
 
                $from = $skin->link( $title );
                $edit = $skin->link( $title, wfMsgExt( 'parentheses', array( 
'escape' ), wfMsg( 'editlink' ) ) ,
                        array(), array( 'redirect' => 'no', 'action' => 'edit' 
) );
-               $arr  = $wgContLang->getArrow();
+               $arr  = wfUILang()->getArrow();
                $to   = $skin->link( $dp );
 
                return "$from $edit $arr $to";

Modified: trunk/phase3/includes/specials/SpecialDoubleRedirects.php
===================================================================
--- trunk/phase3/includes/specials/SpecialDoubleRedirects.php   2011-06-21 
10:13:49 UTC (rev 90516)
+++ trunk/phase3/includes/specials/SpecialDoubleRedirects.php   2011-06-21 
10:14:34 UTC (rev 90517)
@@ -76,8 +76,6 @@
        }
 
        function formatResult( $skin, $result ) {
-               global $wgContLang;
-
                $titleA = Title::makeTitle( $result->namespace, $result->title 
);
 
                if ( $result && !isset( $result->nsb ) ) {
@@ -119,7 +117,7 @@
                        array( 'redirect' => 'no' )
                );
                $linkC = $skin->linkKnown( $titleC );
-               $arr = $wgContLang->getArrow() . $wgContLang->getDirMark();
+               $arr = wfUILang()->getArrow() . wfUILang()->getDirMark();
 
                return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
        }

Modified: trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php
===================================================================
--- trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php       
2011-06-21 10:13:49 UTC (rev 90516)
+++ trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php       
2011-06-21 10:14:34 UTC (rev 90517)
@@ -91,7 +91,7 @@
        }
 
        function execute( $par ) {
-               global $wgRequest, $wgOut, $wgLang, $wgContLang, $wgScript;
+               global $wgRequest, $wgOut, $wgLang, $wgScript;
 
                $this->setHeaders();
                $this->outputHeader();
@@ -126,7 +126,7 @@
                }
 
                if( $this->hash != '' ) {
-                       $align = $wgContLang->alignEnd();
+                       $align = wfUILang()->alignEnd();
 
                        # Show a thumbnail of the file
                        $img = $this->file;

Modified: trunk/phase3/includes/specials/SpecialListredirects.php
===================================================================
--- trunk/phase3/includes/specials/SpecialListredirects.php     2011-06-21 
10:13:49 UTC (rev 90516)
+++ trunk/phase3/includes/specials/SpecialListredirects.php     2011-06-21 
10:14:34 UTC (rev 90517)
@@ -96,8 +96,6 @@
        }
 
        function formatResult( $skin, $result ) {
-               global $wgContLang;
-
                # Make a link to the redirect itself
                $rd_title = Title::makeTitle( $result->namespace, 
$result->title );
                $rd_link = $skin->link(
@@ -111,7 +109,7 @@
                $target = $this->getRedirectTarget( $result );
                if( $target ) {
                        # Make a link to the destination page
-                       $arr = $wgContLang->getArrow() . 
$wgContLang->getDirMark();
+                       $arr = wfUILang()->getArrow() . 
wfUILang()->getDirMark();
                        $targetLink = $skin->link( $target );
                        return "$rd_link $arr $targetLink";
                } else {

Modified: trunk/phase3/includes/specials/SpecialNewpages.php
===================================================================
--- trunk/phase3/includes/specials/SpecialNewpages.php  2011-06-21 10:13:49 UTC 
(rev 90516)
+++ trunk/phase3/includes/specials/SpecialNewpages.php  2011-06-21 10:14:34 UTC 
(rev 90517)
@@ -289,7 +289,7 @@
         * @return String
         */
        public function formatRow( $result ) {
-               global $wgLang, $wgContLang;
+               global $wgLang;
 
                # Revision deletion works on revisions, so we should cast one
                $row = array(
@@ -302,7 +302,7 @@
 
                $classes = array();
 
-               $dm = $wgContLang->getDirMark();
+               $dm = wfUILang()->getDirMark();
 
                $title = Title::makeTitleSafe( $result->rc_namespace, 
$result->rc_title );
                $time = Html::element( 'span', array( 'class' => 
'mw-newpages-time' ),

Modified: trunk/phase3/includes/specials/SpecialProtectedpages.php
===================================================================
--- trunk/phase3/includes/specials/SpecialProtectedpages.php    2011-06-21 
10:13:49 UTC (rev 90516)
+++ trunk/phase3/includes/specials/SpecialProtectedpages.php    2011-06-21 
10:14:34 UTC (rev 90517)
@@ -76,7 +76,7 @@
         * @return string Formatted <li> element
         */
        public function formatRow( $row ) {
-               global $wgUser, $wgLang, $wgContLang;
+               global $wgUser, $wgLang;
 
                wfProfileIn( __METHOD__ );
 
@@ -116,7 +116,7 @@
                }
 
                if(!is_null($size = $row->page_len)) {
-                       $stxt = $wgContLang->getDirMark() . ' ' . 
$skin->formatRevisionSize( $size );
+                       $stxt = wfUILang()->getDirMark() . ' ' . 
$skin->formatRevisionSize( $size );
                }
 
                # Show a link to the change protection form for allowed users 
otherwise a link to the protection log

Modified: trunk/phase3/includes/specials/SpecialShortpages.php
===================================================================
--- trunk/phase3/includes/specials/SpecialShortpages.php        2011-06-21 
10:13:49 UTC (rev 90516)
+++ trunk/phase3/includes/specials/SpecialShortpages.php        2011-06-21 
10:14:34 UTC (rev 90517)
@@ -86,8 +86,8 @@
        }
 
        function formatResult( $skin, $result ) {
-               global $wgLang, $wgContLang;
-               $dm = $wgContLang->getDirMark();
+               global $wgLang;
+               $dm = wfUILang()->getDirMark();
 
                $title = Title::makeTitle( $result->namespace, $result->title );
                if ( !$title ) {

Modified: trunk/phase3/includes/specials/SpecialVersion.php
===================================================================
--- trunk/phase3/includes/specials/SpecialVersion.php   2011-06-21 10:13:49 UTC 
(rev 90516)
+++ trunk/phase3/includes/specials/SpecialVersion.php   2011-06-21 10:14:34 UTC 
(rev 90517)
@@ -49,7 +49,7 @@
         * main()
         */
        public function execute( $par ) {
-               global $wgOut, $wgSpecialVersionShowHooks, $wgContLang, 
$wgRequest;
+               global $wgOut, $wgSpecialVersionShowHooks, $wgRequest;
 
                $this->setHeaders();
                $this->outputHeader();


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to