Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/59987


Change subject: Upstream skin changes - getLanguageUrls
......................................................................

Upstream skin changes - getLanguageUrls

See related commit: I4a49e704f6fe72c74ecb9103fb081aed93a86de7

Change-Id: I04b625c8d76bb6a061e3201847bf97185c6b7a29
---
M includes/skins/MinervaTemplate.php
M includes/skins/SkinMobile.php
M includes/skins/SkinMobileBase.php
3 files changed, 1 insertion(+), 38 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/87/59987/1

diff --git a/includes/skins/MinervaTemplate.php 
b/includes/skins/MinervaTemplate.php
index 92df280..d32fae2 100644
--- a/includes/skins/MinervaTemplate.php
+++ b/includes/skins/MinervaTemplate.php
@@ -5,7 +5,6 @@
                $this->set( 'content_navigation', array(
                        'variants' => array(),
                ) );
-               $this->set( 'language_urls', array() );
        }
 
        public function execute() {
diff --git a/includes/skins/SkinMobile.php b/includes/skins/SkinMobile.php
index 70e459a..115e368 100644
--- a/includes/skins/SkinMobile.php
+++ b/includes/skins/SkinMobile.php
@@ -47,7 +47,6 @@
 
                $this->prepareTemplatePageContent( $tpl );
                $this->prepareTemplateLinks( $tpl );
-               $tpl->set( 'language_urls', $this->getLanguages() );
                $tpl->set( 'content_navigation', array(
                        'variants' => $this->getLanguageVariants(),
                ) );
@@ -309,42 +308,6 @@
                } else if ( $action === 'history' ) {
                        $out->addModules( 'mobile.action.history' );
                }
-       }
-
-       /*
-               FIXME: Should be a function of SkinTemplate in core - currently 
this code
-               is bundled inside the outputPage function which we override
-               (grep for $tpl->set( 'language_urls', false );)
-       */
-       public function getLanguages() {
-               global $wgContLang;
-
-               wfProfileIn( __METHOD__ );
-               $context = MobileContext::singleton();
-               $languageUrls = array();
-               $out = $this->getOutput();
-
-               foreach ( $out->getLanguageLinks() as $l ) {
-                       $tmp = explode( ':', $l, 2 );
-                       $class = 'interwiki-' . $tmp[0];
-                       $lang = $tmp[0];
-                       unset( $tmp );
-                       $nt = Title::newFromText( $l );
-                       if ( $nt ) {
-                               $languageUrl = $context->getMobileUrl( 
$nt->getFullURL() );
-                               $languageUrls[] = array(
-                                       'href' => $languageUrl,
-                                       'text' => ( 
$wgContLang->fetchLanguageName( $nt->getInterwiki() ) != ''
-                                               ? 
$wgContLang->fetchLanguageName( $nt->getInterwiki() )
-                                               : $l ),
-                                       'language' => 
$wgContLang->fetchLanguageName( $lang ),
-                                       'class' => $class,
-                                       'lang' => $lang,
-                               );
-                       }
-               }
-               wfProfileOut( __METHOD__ );
-               return $languageUrls;
        }
 
        /*
diff --git a/includes/skins/SkinMobileBase.php 
b/includes/skins/SkinMobileBase.php
index 32852dc..4c54d01 100644
--- a/includes/skins/SkinMobileBase.php
+++ b/includes/skins/SkinMobileBase.php
@@ -152,6 +152,7 @@
                $tpl->set( 'watchlistUrl', SpecialPage::getTitleFor( 
'Watchlist' )->getLocalUrl() );
                $tpl->set( 'searchField', $this->getRequest()->getText( 
'search', '' ) );
                $tpl->set( 'loggedin', $this->getUser()->isLoggedIn() );
+               $tpl->set( 'language_urls', $this->getLanguages() );
 
                wfProfileOut( __METHOD__ );
                return $tpl;

-- 
To view, visit https://gerrit.wikimedia.org/r/59987
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I04b625c8d76bb6a061e3201847bf97185c6b7a29
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to