Index: trunk/phase3/includes/CategoryPage.php |
— | — | @@ -143,7 +143,7 @@ |
144 | 144 | * @return string HTML output |
145 | 145 | */ |
146 | 146 | public function getHTML() { |
147 | | - global $wgOut, $wgCategoryMagicGallery, $wgContLang; |
| 147 | + global $wgOut, $wgCategoryMagicGallery, $wgContLang, $wgBetterDirectionality; |
148 | 148 | wfProfileIn( __METHOD__ ); |
149 | 149 | |
150 | 150 | $this->showGallery = $wgCategoryMagicGallery && !$wgOut->mNoGallery; |
— | — | @@ -174,9 +174,8 @@ |
175 | 175 | $r = wfMsgExt( 'category-empty', array( 'parse' ) ); |
176 | 176 | } |
177 | 177 | |
178 | | - global $wgBetterDirectionality, $wgTitle; |
179 | 178 | if( $wgBetterDirectionality ) { |
180 | | - $pageLang = $wgTitle->getPageLanguage(); |
| 179 | + $pageLang = $this->title->getPageLanguage(); |
181 | 180 | $langAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() ); |
182 | 181 | # close the previous div, show the headings in user language, |
183 | 182 | # then open a new div with the page content language again |
— | — | @@ -504,6 +503,8 @@ |
505 | 504 | * @private |
506 | 505 | */ |
507 | 506 | function formatList( $articles, $articles_start_char, $cutoff = 6 ) { |
| 507 | + global $wgBetterDirectionality; |
| 508 | + |
508 | 509 | $list = ''; |
509 | 510 | if ( count ( $articles ) > $cutoff ) { |
510 | 511 | $list = self::columnList( $articles, $articles_start_char ); |
— | — | @@ -511,9 +512,9 @@ |
512 | 513 | // for short lists of articles in categories. |
513 | 514 | $list = self::shortList( $articles, $articles_start_char ); |
514 | 515 | } |
515 | | - global $wgBetterDirectionality, $wgTitle; |
| 516 | + |
516 | 517 | if( $wgBetterDirectionality ) { |
517 | | - $pageLang = $wgTitle->getPageLanguage(); |
| 518 | + $pageLang = $this->title->getPageLanguage(); |
518 | 519 | $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(), |
519 | 520 | 'class' => 'mw-content-'.$pageLang->getDir() ); |
520 | 521 | $list = Html::rawElement( 'div', $attribs, $list ); |