Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/349353 )

Change subject: Drop SkinMinervaBeta
......................................................................

Drop SkinMinervaBeta

beta flag is now set as a skin option when the skin is created
The config value wgMFMode is set completely separately so all
this does is control the class on the body tag

Change-Id: If801b436fa8a1b7059238e3063321bfc4a299eb3
---
M extension.json
M includes/Minerva.hooks.php
M includes/skins/SkinMinerva.php
D includes/skins/SkinMinervaBeta.php
4 files changed, 8 insertions(+), 27 deletions(-)


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

diff --git a/extension.json b/extension.json
index 59c40ac..e734357 100644
--- a/extension.json
+++ b/extension.json
@@ -87,7 +87,6 @@
                "MinervaTemplate": "includes/skins/MinervaTemplate.php",
                "MFResourceLoaderParsedMessageModule": 
"includes/modules/MFResourceLoaderParsedMessageModule.php",
                "SkinMinerva": "includes/skins/SkinMinerva.php",
-               "SkinMinervaBeta": "includes/skins/SkinMinervaBeta.php",
                "ICustomizableSkin": "includes/skins/ICustomizableSkin.php",
                "MobileFrontend\\MenuBuilder": "includes/MenuBuilder.php",
                "MobileFrontend\\MenuEntry": "includes/MenuBuilder.php",
diff --git a/includes/Minerva.hooks.php b/includes/Minerva.hooks.php
index d74d02d..4ba1a96 100644
--- a/includes/Minerva.hooks.php
+++ b/includes/Minerva.hooks.php
@@ -70,6 +70,8 @@
                // setSkinOptions is not available
                if ( $skin instanceof SkinMinerva ) {
                        $skin->setSkinOptions( [
+                               SkinMinerva::OPTIONS_MOBILE_BETA
+                                       => $mobileContext->isBetaGroupMember(),
                                SkinMinerva::OPTION_PRINT_STYLES
                                        => $mobileContext->getConfigVariable( 
'MinervaPrintStyles' ),
                                SkinMinerva::OPTION_CATEGORIES
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 690aa8e..5ef42a5 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -18,6 +18,7 @@
        const OPTION_BACK_TO_TOP = 'backToTop';
        const OPTION_TOGGLING = 'toggling';
        const OPTION_PRINT_STYLES = 'printStyles';
+       const OPTIONS_MOBILE_BETA = 'beta';
 
        /** @var string $skinname Name of this skin */
        public $skinname = 'minerva';
@@ -25,8 +26,6 @@
        public $template = 'MinervaTemplate';
        /** @var boolean $useHeadElement Specify whether show head elements */
        public $useHeadElement = true;
-       /** @var string $mode Describes 'stability' of the skin - beta, stable 
*/
-       protected $mode = 'stable';
        /** @var bool whether the page is the user's page, i.e. User:Username */
        public $isUserPage = false;
        /** @var ContentHandler Content handler of page; only access through 
getContentHandler */
@@ -47,6 +46,7 @@
 
        /** @var array skin specific options */
        protected $skinOptions = [
+               self::OPTIONS_MOBILE_BETA => false,
                /**
                 * Whether the main menu should include a link to
                 * Special:Preferences of Special:MobileOptions
@@ -257,7 +257,10 @@
         */
        public function getPageClasses( $title ) {
                $className = parent::getPageClasses( $title );
-               $className .= ' ' . $this->getMode();
+               if ( $this->getSkinOption( self::OPTIONS_MOBILE_BETA ) ) {
+                       $className .= ' beta';
+               }
+
                if ( $title->isMainPage() ) {
                        $className .= ' page-Main_Page ';
                } elseif ( $title->isSpecialPage() ) {
@@ -268,14 +271,6 @@
                        $className .= ' is-authenticated';
                }
                return $className;
-       }
-
-       /**
-        * Get the current mode of the skin [stable|beta] that is running
-        * @return string
-        */
-       protected function getMode() {
-               return $this->mode;
        }
 
        /**
diff --git a/includes/skins/SkinMinervaBeta.php 
b/includes/skins/SkinMinervaBeta.php
deleted file mode 100644
index 2e351a7..0000000
--- a/includes/skins/SkinMinervaBeta.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-
-/**
- * SkinMinervaBeta.php
- */
-
-/**
- * Beta-Implementation of stable class SkinMinerva
- */
-class SkinMinervaBeta extends SkinMinerva {
-       /** @var string $template Name of this template */
-       public $template = 'MinervaTemplate';
-       /** @var string $mode Describes 'stability' of the skin - beta, stable 
*/
-       protected $mode = 'beta';
-}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If801b436fa8a1b7059238e3063321bfc4a299eb3
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