From: Alexandre Emsenhuber Date: Mon, 4 Jul 2011 08:40:41 +0000 (+0000) Subject: Fix for r90337 and r90743: Use $this->title instead of $wgTitle, also groupped global... X-Git-Tag: 1.31.0-rc.0~29089 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=4c0d6c69dde375a62be4852c2067d0fc4775b1d4;p=lhc%2Fweb%2Fwiklou.git Fix for r90337 and r90743: Use $this->title instead of $wgTitle, also groupped global declarations at the top --- diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 809466bc20..c9f4564aae 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -143,7 +143,7 @@ class CategoryViewer { * @return string HTML output */ public function getHTML() { - global $wgOut, $wgCategoryMagicGallery, $wgContLang; + global $wgOut, $wgCategoryMagicGallery, $wgContLang, $wgBetterDirectionality; wfProfileIn( __METHOD__ ); $this->showGallery = $wgCategoryMagicGallery && !$wgOut->mNoGallery; @@ -174,9 +174,8 @@ class CategoryViewer { $r = wfMsgExt( 'category-empty', array( 'parse' ) ); } - global $wgBetterDirectionality, $wgTitle; if( $wgBetterDirectionality ) { - $pageLang = $wgTitle->getPageLanguage(); + $pageLang = $this->title->getPageLanguage(); $langAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() ); # close the previous div, show the headings in user language, # then open a new div with the page content language again @@ -504,6 +503,8 @@ class CategoryViewer { * @private */ function formatList( $articles, $articles_start_char, $cutoff = 6 ) { + global $wgBetterDirectionality; + $list = ''; if ( count ( $articles ) > $cutoff ) { $list = self::columnList( $articles, $articles_start_char ); @@ -511,9 +512,9 @@ class CategoryViewer { // for short lists of articles in categories. $list = self::shortList( $articles, $articles_start_char ); } - global $wgBetterDirectionality, $wgTitle; + if( $wgBetterDirectionality ) { - $pageLang = $wgTitle->getPageLanguage(); + $pageLang = $this->title->getPageLanguage(); $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(), 'class' => 'mw-content-'.$pageLang->getDir() ); $list = Html::rawElement( 'div', $attribs, $list );