Merge "OutputPage.php: Use descriptive $variant instead of $_v as local variable"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 24 Jul 2015 16:58:35 +0000 (16:58 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 24 Jul 2015 16:58:35 +0000 (16:58 +0000)
1  2 
includes/OutputPage.php

diff --combined includes/OutputPage.php
@@@ -3433,11 -3433,11 +3433,11 @@@ class OutputPage extends ContextSource 
                        $lang = $this->getTitle()->getPageLanguage();
                        if ( $lang->hasVariants() ) {
                                $variants = $lang->getVariants();
-                               foreach ( $variants as $_v ) {
-                                       $tags["variant-$_v"] = Html::element( 'link', array(
+                               foreach ( $variants as $variant ) {
+                                       $tags["variant-$variant"] = Html::element( 'link', array(
                                                'rel' => 'alternate',
-                                               'hreflang' => wfBCP47( $_v ),
-                                               'href' => $this->getTitle()->getLocalURL( array( 'variant' => $_v ) ) )
+                                               'hreflang' => wfBCP47( $variant ),
+                                               'href' => $this->getTitle()->getLocalURL( array( 'variant' => $variant ) ) )
                                        );
                                }
                                # x-default link per https://support.google.com/webmasters/answer/189077?hl=en
         * @since 1.25
         */
        public function enableOOUI() {
 -              OOUI\Theme::setSingleton( new OOUI\MediaWikiTheme() );
 +              $themes = ExtensionRegistry::getInstance()->getAttribute( 'SkinOOUIThemes' );
 +              // Make keys (skin names) lowercase for case-insensitive matching.
 +              $themes = array_change_key_case( $themes, CASE_LOWER );
 +              $skinName = strtolower( $this->getSkin()->getSkinName() );
 +              $theme = isset( $themes[ $skinName ] ) ? $themes[ $skinName ] : 'MediaWiki';
 +              // For example, 'OOUI\MediaWikiTheme'.
 +              $themeClass = "OOUI\\{$theme}Theme";
 +              OOUI\Theme::setSingleton( new $themeClass() );
                OOUI\Element::setDefaultDir( $this->getLanguage()->getDir() );
                $this->addModuleStyles( array(
                        'oojs-ui.styles',