Bmansurov has uploaded a new change for review.

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

Change subject: Beta: Allow displaying Related Articles in the footer
......................................................................

Beta: Allow displaying Related Articles in the footer

Even if 'minerva' is blacklisted, show Related Articles in the footer.

Bug: T144912
Change-Id: I366c8656a0f14a7069053b2e6199caac20471ea4
---
M includes/MobileFrontend.hooks.php
1 file changed, 15 insertions(+), 0 deletions(-)


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

diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 56700d0..0c82c8a 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -148,13 +148,28 @@
         * @see 
https://www.mediawiki.org/wiki/Manual:Hooks/SkinTemplateOutputPageBeforeExec
         *
         * Adds a link to view the current page in 'mobile view' to the desktop 
footer.
+        * Also enables Related Articles in the footer in the beta mode.
         *
         * @param SkinTemplate $skin
         * @param QuickTemplate $tpl
         * @return bool
         */
        public static function onSkinTemplateOutputPageBeforeExec( &$skin, 
&$tpl ) {
+               global $wgRelatedArticlesFooterBlacklistedSkins, 
$wgRelatedArticlesShowInFooter;
+
                MobileFrontendSkinHooks::prepareFooter( $skin, $tpl );
+
+               // Configure related articles to be shown in the footer for the 
beta mode
+               if (
+                       ExtensionRegistry::getInstance()->isLoaded( 
'RelatedArticles' ) &&
+                       MobileContext::singleton()->isBetaGroupMember()
+               ) {
+                       $wgRelatedArticlesShowInFooter = true;
+                       if ( in_array( 'minerva', 
$wgRelatedArticlesFooterBlacklistedSkins ?: [] ) ) {
+                               unset( 
$wgRelatedArticlesFooterBlacklistedSkins[ 'minerva' ] );
+                       }
+               }
+
                return true;
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I366c8656a0f14a7069053b2e6199caac20471ea4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <bmansu...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to