jenkins-bot has submitted this change and it was merged.
Change subject: Promote menu button generation to MinervaTemplate
......................................................................
Promote menu button generation to MinervaTemplate
This will allow reuse by desktop skin
Change-Id: I4dda1436a1ef5dbdba72d3959c947f958d36aa74
---
M includes/skins/MinervaTemplate.php
M includes/skins/SkinMobile.php
M includes/skins/SkinMobileTemplate.php
3 files changed, 11 insertions(+), 11 deletions(-)
Approvals:
MaxSem: Verified; Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/skins/MinervaTemplate.php
b/includes/skins/MinervaTemplate.php
index 92df280..6eb2c60 100644
--- a/includes/skins/MinervaTemplate.php
+++ b/includes/skins/MinervaTemplate.php
@@ -6,11 +6,20 @@
'variants' => array(),
) );
$this->set( 'language_urls', array() );
+
+ // menu button
+ $url = SpecialPage::getTitleFor( 'MobileMenu' )->getLocalUrl()
. '#mw-mf-page-left';
+ $this->set( 'menuButton',
+ Html::element( 'a', array(
+ 'title' => wfMessage(
'mobile-frontend-main-menu-button-tooltip' ),
+ 'href' => $url,
+ 'id'=> 'mw-mf-main-menu-button',
+ ) )
+ );
}
public function execute() {
$this->prepareCommonData();
- parent::execute();
}
public function getLanguageVariants() {
diff --git a/includes/skins/SkinMobile.php b/includes/skins/SkinMobile.php
index 70e459a..70fe3ff 100644
--- a/includes/skins/SkinMobile.php
+++ b/includes/skins/SkinMobile.php
@@ -16,7 +16,6 @@
$user = $this->getUser();
$tpl->set( 'title', $title );
$tpl->set( 'user', $user );
- $tpl->set( 'menuButton', self::getMenuButton() );
$context = MobileContext::singleton();
$device = $context->getDevice();
@@ -427,14 +426,5 @@
'text' => $text,
'href' => $url,
);
- }
-
- public static function getMenuButton() {
- $url = SpecialPage::getTitleFor( 'MobileMenu' )->getLocalUrl()
. '#mw-mf-page-left';
- return Html::element( 'a', array(
- 'title' => wfMessage(
'mobile-frontend-main-menu-button-tooltip' )->text(),
- 'href' => $url,
- 'id'=> 'mw-mf-main-menu-button',
- ) );
}
}
diff --git a/includes/skins/SkinMobileTemplate.php
b/includes/skins/SkinMobileTemplate.php
index 89c2500..5c1b066 100644
--- a/includes/skins/SkinMobileTemplate.php
+++ b/includes/skins/SkinMobileTemplate.php
@@ -49,6 +49,7 @@
}
public function execute() {
+ parent::execute();
$this->prepareData();
$this->html( 'headelement' );
$this->renderArticleSkin();
--
To view, visit https://gerrit.wikimedia.org/r/58990
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4dda1436a1ef5dbdba72d3959c947f958d36aa74
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits