Use local context instead of global variables
[lhc/web/wiklou.git] / includes / specials / SpecialAllmessages.php
index d65f25f..8f41c82 100644 (file)
@@ -71,7 +71,7 @@ class SpecialAllmessages extends SpecialPage {
                        wfGetLangObj( $request->getVal( 'lang', $par ) )
                );
 
-               $this->langCode = $this->table->lang->getCode();
+               $this->langcode = $this->table->lang->getCode();
 
                $out->addHTML( $this->table->buildForm() .
                        $this->table->getNavigationBar() .
@@ -82,23 +82,16 @@ class SpecialAllmessages extends SpecialPage {
 
 }
 
-
-
 /**
  * Use TablePager for prettified output. We have to pretend that we're
  * getting data from a table when in fact not all of it comes from the database.
  */
 class AllmessagesTablePager extends TablePager {
 
-       protected $filter, $prefix, $langCode;
+       protected $filter, $prefix, $langcode, $displayPrefix;
 
        public $mLimitsShown;
 
-       /**
-        * @var Skin
-        */
-       protected $mSkin;
-
        /**
         * @var Language
         */
@@ -134,11 +127,12 @@ class AllmessagesTablePager extends TablePager {
                $prefix = $wgLang->ucfirst( $wgRequest->getVal( 'prefix', '' ) );
                $prefix = $prefix != '' ? Title::makeTitleSafe( NS_MEDIAWIKI, $wgRequest->getVal( 'prefix', null ) ) : null;
                if( $prefix !== null ){
-                       $this->prefix = '/^' . preg_quote( $prefix->getDBkey() ) . '/i';
+                       $this->displayPrefix = $prefix->getDBkey();
+                       $this->prefix = '/^' . preg_quote( $this->displayPrefix ) . '/i';
                } else {
+                       $this->displayPrefix = false;
                        $this->prefix = false;
                }
-               $this->getSkin();
 
                // The suffix that may be needed for message names if we're in a
                // different language (eg [[MediaWiki:Foo/fr]]: $suffix = '/fr'
@@ -164,7 +158,7 @@ class AllmessagesTablePager extends TablePager {
                                        Xml::label( wfMsg( 'allmessages-prefix' ), 'mw-allmessages-form-prefix' ) .
                                "</td>\n
                                <td class=\"mw-input\">" .
-                                       Xml::input( 'prefix', 20, str_replace( '_', ' ', $this->prefix ), array( 'id' => 'mw-allmessages-form-prefix' ) ) .
+                                       Xml::input( 'prefix', 20, str_replace( '_', ' ', $this->displayPrefix ), array( 'id' => 'mw-allmessages-form-prefix' ) ) .
                                "</td>\n
                        </tr>
                        <tr>\n
@@ -351,9 +345,9 @@ class AllmessagesTablePager extends TablePager {
                                $talk  = Title::makeTitle( NS_MEDIAWIKI_TALK, $value . $this->suffix );
 
                                if( $this->mCurrentRow->am_customised ){
-                                       $title = $this->mSkin->linkKnown( $title, $wgLang->lcfirst( $value ) );
+                                       $title = Linker::linkKnown( $title, $wgLang->lcfirst( $value ) );
                                } else {
-                                       $title = $this->mSkin->link(
+                                       $title = Linker::link(
                                                $title,
                                                $wgLang->lcfirst( $value ),
                                                array(),
@@ -362,9 +356,9 @@ class AllmessagesTablePager extends TablePager {
                                        );
                                }
                                if ( $this->mCurrentRow->am_talk_exists ) {
-                                       $talk = $this->mSkin->linkKnown( $talk , $this->talk );
+                                       $talk = Linker::linkKnown( $talk , $this->talk );
                                } else {
-                                       $talk = $this->mSkin->link(
+                                       $talk = Linker::link(
                                                $talk,
                                                $this->talk,
                                                array(),
@@ -411,8 +405,7 @@ class AllmessagesTablePager extends TablePager {
        }
 
        function getCellAttrs( $field, $value ){
-               global $wgBetterDirectionality;
-               if( $field != 'am_title' && $wgBetterDirectionality ) {
+               if( $field != 'am_title' ) {
                        return array( 'lang' => $this->langcode, 'dir' => $this->lang->getDir() );
                } elseif( $this->mCurrentRow->am_customised && $field == 'am_title' ) {
                        return array( 'rowspan' => '2', 'class' => $field );