Third batch of files modified to replace selected wgLang with wgContLang
authorZheng Zhu <zhengzhu@users.mediawiki.org>
Fri, 24 Sep 2004 16:45:31 +0000 (16:45 +0000)
committerZheng Zhu <zhengzhu@users.mediawiki.org>
Fri, 24 Sep 2004 16:45:31 +0000 (16:45 +0000)
includes/SpecialRecentchanges.php
includes/SpecialRecentchangeslinked.php
includes/SpecialUndelete.php
includes/SpecialUnusedimages.php
includes/SpecialUpload.php
includes/SpecialWantedpages.php
includes/SpecialWatchlist.php
includes/Title.php
includes/Tokenizer.php
includes/WebRequest.php

index 56e1509..4d468a7 100644 (file)
@@ -14,8 +14,8 @@ require_once( 'Feed.php' );
  * Constructor
  */
 function wfSpecialRecentchanges( $par ) {
-       global $wgUser, $wgOut, $wgLang, $wgTitle, $wgMemc, $wgDBname;
-       global $wgRequest, $wgSitename, $wgLanguageCode;
+       global $wgUser, $wgOut, $wgLang, $wgContLang, $wgTitle, $wgMemc, $wgDBname;
+       global $wgRequest, $wgSitename, $wgLanguageCode, $wgContLanguageCode;
        global $wgFeedClasses;
        $fname = 'wfSpecialRecentchanges';
 
@@ -86,13 +86,13 @@ function wfSpecialRecentchanges( $par ) {
                            'hidebots'  => $hidebots,   'hidepatrolled' => $hidepatrolled);
        $hideparams = wfArrayToCGI( $urlparams );
 
-       $minorLink = $sk->makeKnownLink( $wgLang->specialPage( 'Recentchanges' ),
+       $minorLink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchanges' ),
          $showhide[1-$hideminor], wfArrayToCGI( array( 'hideminor' => 1-$hideminor ), $urlparams ) );
-       $botLink = $sk->makeKnownLink( $wgLang->specialPage( 'Recentchanges' ),
+       $botLink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchanges' ),
          $showhide[1-$hidebots], wfArrayToCGI( array( 'hidebots' => 1-$hidebots ), $urlparams ) );
-       $liuLink = $sk->makeKnownLink( $wgLang->specialPage( 'Recentchanges' ),
+       $liuLink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchanges' ),
          $showhide[1-$hideliu], wfArrayToCGI( array( 'hideliu' => 1-$hideliu ), $urlparams ) );
-       $patrLink = $sk->makeKnownLink( $wgLang->specialPage( 'Recentchanges' ),
+       $patrLink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchanges' ),
          $showhide[1-$hidepatrolled], wfArrayToCGI( array( 'hidepatrolled' => 1-$hidepatrolled ), $urlparams ) );
 
        $uid = $wgUser->getID();
@@ -119,14 +119,14 @@ function wfSpecialRecentchanges( $par ) {
        $note = rcDayLimitLinks( $days, $limit, 'Recentchanges', $hideparams, false, $minorLink, $botLink, $liuLink, $patrLink );
 
        $note .= "<br />\n" . wfMsg( 'rclistfrom',
-         $sk->makeKnownLink( $wgLang->specialPage( 'Recentchanges' ),
+         $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchanges' ),
          $wgLang->timeanddate( $now, true ), $hideparams.'&from='.$now ) );
 
        $wgOut->addHTML( $note."\n" );
 
        if( isset($wgFeedClasses[$feedFormat]) ) {
                $feed = new $wgFeedClasses[$feedFormat](
-                       $wgSitename . ' - ' . wfMsg( 'recentchanges' ) . ' [' . $wgLanguageCode . ']',
+                       $wgSitename . ' - ' . wfMsg( 'recentchanges' ) . ' [' . $wgContLanguageCode . ']',
                        htmlspecialchars( wfMsg( 'recentchangestext' ) ),
                        $wgTitle->getFullUrl() );
                $feed->outHeader();
@@ -170,9 +170,9 @@ function wfSpecialRecentchanges( $par ) {
  *
  */
 function rcCountLink( $lim, $d, $page='Recentchanges', $more='' ) {
-       global $wgUser, $wgLang;
+       global $wgUser, $wgLang, $wgContLang;
        $sk = $wgUser->getSkin();
-       $s = $sk->makeKnownLink( $wgLang->specialPage( $page ),
+       $s = $sk->makeKnownLink( $wgContLang->specialPage( $page ),
          ($lim ? $wgLang->formatNum( "{$lim}" ) : wfMsg( 'all' ) ), "{$more}" .
          ($d ? "days={$d}&" : '') . 'limit='.$lim );
        return $s;
@@ -182,9 +182,9 @@ function rcCountLink( $lim, $d, $page='Recentchanges', $more='' ) {
  *
  */
 function rcDaysLink( $lim, $d, $page='Recentchanges', $more='' ) {
-       global $wgUser, $wgLang;
+       global $wgUser, $wgLang, $wgContLang;
        $sk = $wgUser->getSkin();
-       $s = $sk->makeKnownLink( $wgLang->specialPage( $page ),
+       $s = $sk->makeKnownLink( $wgContLang->specialPage( $page ),
          ($d ? $wgLang->formatNum( "{$d}" ) : wfMsg( "all" ) ), $more.'days='.$d .
          ($lim ? '&limit='.$lim : '') );
        return $s;
index f1df7c2..6f82b35 100644 (file)
@@ -15,7 +15,7 @@ require_once( 'SpecialRecentchanges.php' );
  * @param string $par parent page we will look at
  */
 function wfSpecialRecentchangeslinked( $par = NULL ) {
-       global $wgUser, $wgOut, $wgLang, $wgTitle, $wgRequest;
+       global $wgUser, $wgOut, $wgLang, $wgContLang, $wgTitle, $wgRequest;
        $fname = 'wfSpecialRecentchangeslinked';
 
        $days = $wgRequest->getInt( 'days' );
@@ -53,11 +53,11 @@ function wfSpecialRecentchangeslinked( $par = NULL ) {
 
        $hideminor = ($hideminor ? 1 : 0);
        if ( $hideminor ) {
-               $mlink = $sk->makeKnownLink( $wgLang->specialPage( 'Recentchangeslinked' ),
+               $mlink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchangeslinked' ),
                  WfMsg( 'show' ), 'target=' . htmlspecialchars( $nt->getPrefixedURL() ) .
                  "&days={$days}&limit={$limit}&hideminor=0" );
        } else {
-               $mlink = $sk->makeKnownLink( $wgLang->specialPage( "Recentchangeslinked" ),
+               $mlink = $sk->makeKnownLink( $wgContLang->specialPage( "Recentchangeslinked" ),
                  WfMsg( "hide" ), "target=" . htmlspecialchars( $nt->getPrefixedURL() ) .
                  "&days={$days}&limit={$limit}&hideminor=1" );
        }
index 7ba6bed..d213e56 100644 (file)
@@ -214,7 +214,7 @@ class UndeleteForm {
        }
 
        /* private */ function showList() {
-               global $wgLang, $wgUser, $wgOut;
+               global $wgLang, $wgContLang, $wgUser, $wgOut;
                $fname = "UndeleteForm::showList";
                
                # List undeletable articles    
@@ -228,7 +228,7 @@ class UndeleteForm {
                $wgOut->addHTML( "<ul>\n" );
                while( $row = $result->fetchObject() ) {
                        $n = ($row->ar_namespace ? 
-                               ($wgLang->getNsText( $row->ar_namespace ) . ":") : "").
+                               ($wgContLang->getNsText( $row->ar_namespace ) . ":") : "").
                                $row->ar_title;
                        $link = $sk->makeKnownLinkObj( $undelete,
                                htmlspecialchars( $n ), "target=" . urlencode( $n ) );
index 77bce4d..60a6e18 100644 (file)
@@ -30,9 +30,9 @@ class UnusedimagesPage extends QueryPage {
        }
        
        function formatResult( $skin, $result ) {
-               global $wgLang;
+               global $wgLang, $wgContLang;
                $title = Title::makeTitle( NS_IMAGE, $result->title );
-               $ins = $wgLang->getNsText(NS_IMAGE);
+               $ins = $wgContLang->getNsText(NS_IMAGE);
                
                $return =
                # The 'desc' linking to the image page
@@ -42,7 +42,7 @@ class UnusedimagesPage extends QueryPage {
                # Last modified date
                . ' . . '.$wgLang->timeanddate($result->value)
                # Link to username
-               . ' . . '.$skin->makeLink($wgLang->getNsText(NS_USER).':'.$result->img_user_text,$result->img_user_text);
+               . ' . . '.$skin->makeLink($wgContLang->getNsText(NS_USER).':'.$result->img_user_text,$result->img_user_text);
                
                # If there is a description, show it
                if($result->img_description != '') {
index 6401f85..1b2e907 100644 (file)
@@ -109,7 +109,7 @@ class UploadForm {
         * @access private
         */
        function processUpload() {
-               global $wgUser, $wgOut, $wgLang;
+               global $wgUser, $wgOut, $wgLang, $wgContLang;
                global $wgUploadDirectory;
                global $wgSavedFile, $wgUploadOldVersion;
                global $wgUseCopyrightUpload, $wgCheckCopyrightUpload;
@@ -200,7 +200,7 @@ class UploadForm {
                                }
                                if( $nt->getArticleID() ) {
                                        $sk = $wgUser->getSkin();
-                                       $dname = $wgLang->getNsText( Namespace::getImage() ) .':'.$this->mUploadSaveName;
+                                       $dname = $wgContLang->getNsText( Namespace::getImage() ) .':'.$this->mUploadSaveName;
                                        $dlink = $sk->makeKnownLink( $dname, $dname );
                                        $warning .= '<li>'.wfMsg( 'fileexists', $dlink ).'</li>';
                                }
@@ -219,7 +219,7 @@ class UploadForm {
 
                $sk = $wgUser->getSkin();
                $ilink = $sk->makeMediaLink( $this->mUploadSaveName, Image::wfImageUrl( $this->mUploadSaveName ) );
-               $dname = $wgLang->getNsText( Namespace::getImage() ) . ':'.$this->mUploadSaveName;
+               $dname = $wgContLang->getNsText( Namespace::getImage() ) . ':'.$this->mUploadSaveName;
                $dlink = $sk->makeKnownLink( $dname, $dname );
 
                $wgOut->addHTML( '<h2>' . wfMsg( 'successfulupload' ) . "</h2>\n" );
index 7fd09db..001dc30 100644 (file)
@@ -49,7 +49,7 @@ class WantedPagesPage extends QueryPage {
         }
 
        function formatResult( $skin, $result ) {
-               global $wgLang;
+               global $wgContLang;
 
                $nt = Title::newFromDBkey( $result->title );
                if( is_null( $nt ) ) {
@@ -57,7 +57,7 @@ class WantedPagesPage extends QueryPage {
                }
                $plink = $skin->makeBrokenLink( $nt->getPrefixedText(), "" );
                $nl = wfMsg( "nlinks", $result->value );
-               $nlink = $skin->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ), $nl,
+               $nlink = $skin->makeKnownLink( $wgContLang->specialPage( "Whatlinkshere" ), $nl,
                  "target=" . $nt->getPrefixedURL() );
 
                return "{$plink} ({$nlink})";
index 5e4ffa9..5b9abdd 100644 (file)
@@ -208,10 +208,10 @@ function wfSpecialWatchlist() {
 
 
 function wlHoursLink( $h, $page ) {
-       global $wgUser, $wgLang;
+       global $wgUser, $wgLang, $wgContLang;
        $sk = $wgUser->getSkin();
        $s = $sk->makeKnownLink(
-         $wgLang->specialPage( $page ),
+         $wgContLang->specialPage( $page ),
          $wgLang->formatNum( $h ),
          "days=" . ($h / 24.0) );
        return $s;
@@ -219,10 +219,10 @@ function wlHoursLink( $h, $page ) {
 
 
 function wlDaysLink( $d, $page ) {
-       global $wgUser, $wgLang;
+       global $wgUser, $wgLang, $wgContLang;
        $sk = $wgUser->getSkin();
        $s = $sk->makeKnownLink(
-         $wgLang->specialPage( $page ),
+         $wgContLang->specialPage( $page ),
          ($d ? $wgLang->formatNum( $d ) : wfMsg( "all" ) ), "days=$d" );
        return $s;
 }
index a1b9f49..a97eb34 100644 (file)
@@ -235,11 +235,11 @@ class Title {
        # Returns a stripped-down a title string ready for the search index
        # Takes a namespace index and a text-form main part
        /* static */ function indexTitle( $ns, $title ) {
-               global $wgDBminWordLen, $wgLang;
+               global $wgDBminWordLen, $wgContLang;
                require_once( 'SearchEngine.php' );
 
                $lc = SearchEngine::legalSearchChars() . '&#;';
-               $t = $wgLang->stripForSearch( $title );
+               $t = $wgContLang->stripForSearch( $title );
                $t = preg_replace( "/[^{$lc}]+/", ' ', $t );
                $t = strtolower( $t );
 
@@ -257,9 +257,9 @@ class Title {
        
        # Make a prefixed DB key from a DB key and a namespace index
        /* static */ function makeName( $ns, $title ) {
-               global $wgLang;
+               global $wgContLang;
 
-               $n = $wgLang->getNsText( $ns );
+               $n = $wgContLang->getNsText( $ns );
                if ( '' == $n ) { return $title; }
                else { return $n.':'.$title; }
        }
@@ -403,14 +403,14 @@ class Title {
 
        # Get a real URL referring to this title, with interwiki link and fragment
        function getFullURL( $query = '' ) {
-               global $wgLang, $wgArticlePath, $wgServer, $wgScript;
+               global $wgContLang, $wgArticlePath, $wgServer, $wgScript;
 
                if ( '' == $this->mInterwiki ) {
                        $p = $wgArticlePath;
                        return $wgServer . $this->getLocalUrl( $query );
                } else {
                        $baseUrl = $this->getInterwikiLink( $this->mInterwiki );
-                       $namespace = $wgLang->getNsText( $this->mNamespace );
+                       $namespace = $wgContLang->getNsText( $this->mNamespace );
                        if ( '' != $namespace ) {
                                # Can this actually happen? Interwikis shouldn't be parsed.
                                $namepace .= ':';
@@ -660,14 +660,14 @@ class Title {
 
        # Prefixes some arbitrary text with the namespace or interwiki prefix of this object
        /* private */ function prefix( $name ) {
-               global $wgLang;
+               global $wgContLang;
 
                $p = '';
                if ( '' != $this->mInterwiki ) {
                        $p = $this->mInterwiki . ':';
                }
                if ( 0 != $this->mNamespace ) {
-                       $p .= $wgLang->getNsText( $this->mNamespace ) . ':';
+                       $p .= $wgContLang->getNsText( $this->mNamespace ) . ':';
                }
                return $p . $name;
        }
@@ -682,7 +682,7 @@ class Title {
        #
        /* private */ function secureAndSplit()
        {
-               global $wgLang, $wgLocalInterwiki, $wgCapitalLinks;
+               global $wgContLang, $wgLocalInterwiki, $wgCapitalLinks;
                $fname = 'Title::secureAndSplit';
                wfProfileIn( $fname );
                
@@ -691,7 +691,7 @@ class Title {
 
                # Initialisation
                if ( $imgpre === false ) {
-                       $imgpre = ':' . $wgLang->getNsText( Namespace::getImage() ) . ':';
+                       $imgpre = ':' . $wgContLang->getNsText( Namespace::getImage() ) . ':';
                        # % is needed as well
                        $rxTc = '/[^' . Title::legalChars() . ']/';
                }
@@ -738,7 +738,7 @@ class Title {
                                        # Canonical namespace
                                        $t = $m[2];
                                        $this->mNamespace = $ns;
-                               } elseif ( $ns = $wgLang->getNsIndex( $lowerNs )) {
+                               } elseif ( $ns = $wgContLang->getNsIndex( $lowerNs )) {
                                        # Ordinary namespace
                                        $t = $m[2];
                                        $this->mNamespace = $ns;
@@ -796,7 +796,7 @@ class Title {
 
                # Initial capital letter
                if( $wgCapitalLinks && $this->mInterwiki == '') {
-                       $t = $wgLang->ucfirst( $r );
+                       $t = $wgContLang->ucfirst( $r );
                } else {
                        $t = $r;
                }
@@ -1274,7 +1274,7 @@ class Title {
        # Return an array of parents in the form:
        #  $parent => $currentarticle
        function getParentCategories() {
-               global $wgLang,$wgUser;
+               global $wgContLang,$wgUser;
                
                $titlekey = $this->getArticleId();
                $sk =& $wgUser->getSkin();
@@ -1293,8 +1293,8 @@ class Title {
                
                if($dbr->numRows($res) > 0) {
                        while ( $x = $dbr->fetchObject ( $res ) )
-                               //$data[] = Title::newFromText($wgLang->getNSText ( NS_CATEGORY ).':'.$x->cl_to);
-                               $data[$wgLang->getNSText ( NS_CATEGORY ).':'.$x->cl_to] = $this->getFullText();
+                               //$data[] = Title::newFromText($wgContLang->getNSText ( NS_CATEGORY ).':'.$x->cl_to);
+                               $data[$wgContLang->getNSText ( NS_CATEGORY ).':'.$x->cl_to] = $this->getFullText();
                        $dbr->freeResult ( $res ) ;
                } else {
                        $data = '';
index 84a2f06..408826b 100644 (file)
@@ -20,11 +20,11 @@ class Tokenizer {
         * @access private
         */
        function Tokenizer() {
-               global $wgLang;
+               global $wgContLang;
 
                $this->mPos=0;
                $this->mTokenQueue=array();
-               $this->linkPrefixExtension = $wgLang->linkPrefixExtension();
+               $this->linkPrefixExtension = $wgContLang->linkPrefixExtension();
        }
 
        /**
index c4a139d..c4bff6a 100644 (file)
@@ -108,14 +108,14 @@ class WebRequest {
         */
        function getGPCVal( &$arr, $name, $default ) {
                if( isset( $arr[$name] ) ) {
-                       global $wgUseLatin1, $wgServer, $wgLang;
+                       global $wgUseLatin1, $wgServer, $wgContLang;
                        $data = $arr[$name];
                        if( isset( $_GET[$name] ) &&
                                ( empty( $_SERVER['HTTP_REFERER'] ) ||
                                strncmp($wgServer, $_SERVER['HTTP_REFERER'], strlen( $wgServer ) ) ) ) {
                                # For links that came from outside, check for alternate/legacy
                                # character encoding.
-                               $data = $wgLang->checkTitleEncoding( $data );
+                               $data = $wgContLang->checkTitleEncoding( $data );
                        }
                        if( !$wgUseLatin1 ) {
                                require_once( 'normal/UtfNormal.php' );
@@ -140,9 +140,9 @@ class WebRequest {
        function getGPCText( &$arr, $name, $default ) {
                # Text fields may be in an alternate encoding which we should check.
                # Also, strip CRLF line endings down to LF to achieve consistency.
-               global $wgLang;
+               global $wgContLang;
                if( isset( $arr[$name] ) ) {
-                       return str_replace( "\r\n", "\n", $wgLang->recodeInput( $arr[$name] ) );
+                       return str_replace( "\r\n", "\n", $wgContLang->recodeInput( $arr[$name] ) );
                } else {
                        return $default;
                }