Florianschmidtwelzow has uploaded a new change for review.

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

Change subject: Use a better way to add Main menu sitelinks
......................................................................

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, 19 insertions(+), 9 deletions(-)


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

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index ed8f9f5..c49c4ff 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -682,10 +682,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,6 +709,16 @@
                                );
                        }
                }
+
+               return $urls;
+       }
+
+       /**
+        * Prepare site links in footer
+        * @param BaseTemplate $tpl
+        */
+       protected function prepareSiteLinks( BaseTemplate $tpl ) {
+               $urls = $this->getSiteLinks();
                $tpl->set( 'site_urls', $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: newchange
Gerrit-Change-Id: I0edd498930c2dbaea09c89bdd7cff5d2e8df1609
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>

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

Reply via email to