From: Robin Pepermans Date: Tue, 21 Jun 2011 10:14:34 +0000 (+0000) Subject: * Improvements as part of bug 6100: Use wfUILang() instead of $wgContLang where appro... X-Git-Tag: 1.31.0-rc.0~29380 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=15f3df018f72b42e33284444614be30b098a1dcf;p=lhc%2Fweb%2Fwiklou.git * Improvements as part of bug 6100: Use wfUILang() instead of $wgContLang where appropriate * Remove $wgContLang in SpecialVersion per r90302 --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 7069431fb9..2871676112 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2522,8 +2522,7 @@ function in_string( $needle, $str, $insensitive = false ) { } function wfSpecialList( $page, $details ) { - global $wgContLang; - $details = $details ? ' ' . $wgContLang->getDirMark() . "($details)" : ''; + $details = $details ? ' ' . wfUILang()->getDirMark() . "($details)" : ''; return $page . $details; } diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index f488f31b2b..d759017c61 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -364,12 +364,11 @@ class LogEventsList { } private function logComment( $row ) { - global $wgContLang; if( self::isDeleted( $row, LogPage::DELETED_COMMENT ) ) { $comment = '' . wfMsgHtml( 'rev-deleted-comment' ) . ''; } else { - $comment = $wgContLang->getDirMark() . + $comment = wfUILang()->getDirMark() . $this->skin->commentBlock( $row->log_comment ); } return $comment; diff --git a/includes/specials/SpecialBrokenRedirects.php b/includes/specials/SpecialBrokenRedirects.php index 7c87a99665..1ea25aec99 100644 --- a/includes/specials/SpecialBrokenRedirects.php +++ b/includes/specials/SpecialBrokenRedirects.php @@ -77,7 +77,7 @@ class BrokenRedirectsPage extends PageQueryPage { * @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 @@ class BrokenRedirectsPage extends PageQueryPage { array(), array( 'broken' ) ); - $arr = $wgContLang->getArrow(); + $arr = wfUILang()->getArrow(); $out = $from . wfMsg( 'word-separator' ); diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index aba43b4f3a..0497f8f9b2 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -543,7 +543,7 @@ class ContribsPager extends ReverseChronologicalPager { * @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 @@ class ContribsPager extends ReverseChronologicalPager { 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( diff --git a/includes/specials/SpecialDisambiguations.php b/includes/specials/SpecialDisambiguations.php index e62253bc12..bcea5d47bc 100644 --- a/includes/specials/SpecialDisambiguations.php +++ b/includes/specials/SpecialDisambiguations.php @@ -122,14 +122,13 @@ class DisambiguationsPage extends PageQueryPage { } 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"; diff --git a/includes/specials/SpecialDoubleRedirects.php b/includes/specials/SpecialDoubleRedirects.php index 4242a0a334..56d5ded992 100644 --- a/includes/specials/SpecialDoubleRedirects.php +++ b/includes/specials/SpecialDoubleRedirects.php @@ -76,8 +76,6 @@ class DoubleRedirectsPage extends PageQueryPage { } function formatResult( $skin, $result ) { - global $wgContLang; - $titleA = Title::makeTitle( $result->namespace, $result->title ); if ( $result && !isset( $result->nsb ) ) { @@ -119,7 +117,7 @@ class DoubleRedirectsPage extends PageQueryPage { array( 'redirect' => 'no' ) ); $linkC = $skin->linkKnown( $titleC ); - $arr = $wgContLang->getArrow() . $wgContLang->getDirMark(); + $arr = wfUILang()->getArrow() . wfUILang()->getDirMark(); return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" ); } diff --git a/includes/specials/SpecialFileDuplicateSearch.php b/includes/specials/SpecialFileDuplicateSearch.php index 4009fe6b82..93d2f55922 100644 --- a/includes/specials/SpecialFileDuplicateSearch.php +++ b/includes/specials/SpecialFileDuplicateSearch.php @@ -91,7 +91,7 @@ class FileDuplicateSearchPage extends QueryPage { } function execute( $par ) { - global $wgRequest, $wgOut, $wgLang, $wgContLang, $wgScript; + global $wgRequest, $wgOut, $wgLang, $wgScript; $this->setHeaders(); $this->outputHeader(); @@ -126,7 +126,7 @@ class FileDuplicateSearchPage extends QueryPage { } if( $this->hash != '' ) { - $align = $wgContLang->alignEnd(); + $align = wfUILang()->alignEnd(); # Show a thumbnail of the file $img = $this->file; diff --git a/includes/specials/SpecialListredirects.php b/includes/specials/SpecialListredirects.php index bb47c7b5a0..8552717d71 100644 --- a/includes/specials/SpecialListredirects.php +++ b/includes/specials/SpecialListredirects.php @@ -96,8 +96,6 @@ class ListredirectsPage extends QueryPage { } 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 @@ class ListredirectsPage extends QueryPage { $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 { diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index a0825b3c1b..7b962228c2 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -289,7 +289,7 @@ class SpecialNewpages extends IncludableSpecialPage { * @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 @@ class SpecialNewpages extends IncludableSpecialPage { $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' ), diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index 32b4c8740f..68e58db404 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -76,7 +76,7 @@ class SpecialProtectedpages extends SpecialPage { * @return string Formatted
  • element */ public function formatRow( $row ) { - global $wgUser, $wgLang, $wgContLang; + global $wgUser, $wgLang; wfProfileIn( __METHOD__ ); @@ -116,7 +116,7 @@ class SpecialProtectedpages extends SpecialPage { } 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 diff --git a/includes/specials/SpecialShortpages.php b/includes/specials/SpecialShortpages.php index 5a487fc4cc..1f7184326c 100644 --- a/includes/specials/SpecialShortpages.php +++ b/includes/specials/SpecialShortpages.php @@ -86,8 +86,8 @@ class ShortPagesPage extends QueryPage { } function formatResult( $skin, $result ) { - global $wgLang, $wgContLang; - $dm = $wgContLang->getDirMark(); + global $wgLang; + $dm = wfUILang()->getDirMark(); $title = Title::makeTitle( $result->namespace, $result->title ); if ( !$title ) { diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index c5d1411559..c579fbdb7d 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -49,7 +49,7 @@ class SpecialVersion extends SpecialPage { * main() */ public function execute( $par ) { - global $wgOut, $wgSpecialVersionShowHooks, $wgContLang, $wgRequest; + global $wgOut, $wgSpecialVersionShowHooks, $wgRequest; $this->setHeaders(); $this->outputHeader();