r91401 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91400‎ | r91401 | r91402 >
Date:08:40, 4 July 2011
Author:ialex
Status:ok
Tags:
Comment:
Fix for r90337 and r90743: Use $this->title instead of $wgTitle, also groupped global declarations at the top
Modified paths:
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/CategoryPage.php
@@ -143,7 +143,7 @@
144144 * @return string HTML output
145145 */
146146 public function getHTML() {
147 - global $wgOut, $wgCategoryMagicGallery, $wgContLang;
 147+ global $wgOut, $wgCategoryMagicGallery, $wgContLang, $wgBetterDirectionality;
148148 wfProfileIn( __METHOD__ );
149149
150150 $this->showGallery = $wgCategoryMagicGallery && !$wgOut->mNoGallery;
@@ -174,9 +174,8 @@
175175 $r = wfMsgExt( 'category-empty', array( 'parse' ) );
176176 }
177177
178 - global $wgBetterDirectionality, $wgTitle;
179178 if( $wgBetterDirectionality ) {
180 - $pageLang = $wgTitle->getPageLanguage();
 179+ $pageLang = $this->title->getPageLanguage();
181180 $langAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() );
182181 # close the previous div, show the headings in user language,
183182 # then open a new div with the page content language again
@@ -504,6 +503,8 @@
505504 * @private
506505 */
507506 function formatList( $articles, $articles_start_char, $cutoff = 6 ) {
 507+ global $wgBetterDirectionality;
 508+
508509 $list = '';
509510 if ( count ( $articles ) > $cutoff ) {
510511 $list = self::columnList( $articles, $articles_start_char );
@@ -511,9 +512,9 @@
512513 // for short lists of articles in categories.
513514 $list = self::shortList( $articles, $articles_start_char );
514515 }
515 - global $wgBetterDirectionality, $wgTitle;
 516+
516517 if( $wgBetterDirectionality ) {
517 - $pageLang = $wgTitle->getPageLanguage();
 518+ $pageLang = $this->title->getPageLanguage();
518519 $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
519520 'class' => 'mw-content-'.$pageLang->getDir() );
520521 $list = Html::rawElement( 'div', $attribs, $list );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90337Address comment by Platonides on r90320:...robin14:49, 18 June 2011
r90743Directionality improvements as part of bug 6100 (under $wgBetterDirectionality):...robin23:01, 24 June 2011

Status & tagging log