jenkins-bot has submitted this change and it was merged.
Change subject: Hygiene: Use a better way to add Main menu sitelinks
......................................................................
Hygiene: Use a better way to add Main menu sitelinks
Easier and better way to add different sitelinks for different mobile
modes.
Change-Id: I0edd498930c2dbaea09c89bdd7cff5d2e8df1609
---
M includes/skins/SkinMinerva.php
M includes/skins/SkinMinervaAlpha.php
2 files changed, 13 insertions(+), 11 deletions(-)
Approvals:
Jdlrobson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index ed8f9f5..865e8ea 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -68,12 +68,13 @@
// example, on a special page)
$tpl->set( 'unstyledContent', $out->getProperty(
'unstyledContent' ) );
+ $tpl->set( 'site_urls', $this->getSiteLinks() );
+
// Construct various Minerva-specific interface elements
$this->preparePageContent( $tpl );
$this->prepareHeaderAndFooter( $tpl );
$this->prepareMenuButton( $tpl );
$this->prepareBanners( $tpl );
- $this->prepareSiteLinks( $tpl );
$this->prepareWarnings( $tpl );
$this->preparePageActions( $tpl );
$this->prepareUserButton( $tpl );
@@ -682,10 +683,10 @@
}
/**
- * Prepare site links in footer
- * @param BaseTemplate $tpl
+ * Returns an array of sitelinks to add into the main menu footer.
+ * @return Array array of site links
*/
- protected function prepareSiteLinks( BaseTemplate $tpl ) {
+ protected function getSiteLinks() {
$siteLinks = array(
array(
'title' => 'aboutpage',
@@ -709,7 +710,8 @@
);
}
}
- $tpl->set( 'site_urls', $urls );
+
+ return $urls;
}
/**
diff --git a/includes/skins/SkinMinervaAlpha.php
b/includes/skins/SkinMinervaAlpha.php
index 9327969..44770e8 100644
--- a/includes/skins/SkinMinervaAlpha.php
+++ b/includes/skins/SkinMinervaAlpha.php
@@ -62,12 +62,11 @@
}
/**
- * Prepare site links in footer
- * @param BaseTemplate $tpl
+ * Returns an array of sitelinks to add into the main menu footer.
+ * @return Array array of site links
*/
- protected function prepareSiteLinks( BaseTemplate $tpl ) {
- parent::prepareSiteLinks( $tpl );
- $urls = $tpl->get( 'site_urls' );
+ protected function getSiteLinks() {
+ $urls = parent::getSiteLinks();
$msg = $this->msg( 'mobile-frontend-fontchanger-link' );
// Don't add elements, where the message does not exist
if ( !$msg->isDisabled() ) {
@@ -78,7 +77,8 @@
'class' => 'fontchanger link hidden'
);
}
- $tpl->set( 'site_urls', $urls );
+
+ return $urls;
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/178648
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0edd498930c2dbaea09c89bdd7cff5d2e8df1609
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits