jenkins-bot has submitted this change and it was merged.

Change subject: Set $wgMetrolookFeatures in extension.json
......................................................................


Set $wgMetrolookFeatures in extension.json

We can do this now using a merge strategy of "array_plus_2d".

Bug: T113183
Change-Id: I1bd963532a5b341eab756b60bce65ae359c3d943
---
M SkinMetrolookHooks.php
M skin.json
2 files changed, 10 insertions(+), 35 deletions(-)

Approvals:
  Paladox: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/SkinMetrolookHooks.php b/SkinMetrolookHooks.php
index 78340f5..f0c7951 100644
--- a/SkinMetrolookHooks.php
+++ b/SkinMetrolookHooks.php
@@ -28,40 +28,6 @@
 
        /* Static Methods */
 
-       public static function onRegistration() {
-               // Each module may be configured individually to be globally 
on/off or user preference based
-               $features = array(
-                       'collapsiblenav' => array( 'global' => false, 'user' => 
true ),
-               );
-
-               global $wgMetrolookFeatures, $wgDefaultUserOptions;
-
-               /*
-                * Setting default option.
-                *
-                * Do not remove this.
-                *
-                * Bug T76314
-                *
-                * You can add this to your localsettings.php file and change 
from 1 to 0 to disbale it globaly.
-                */
-               $wgDefaultUserOptions['skinmetrolook-collapsiblenav'] = 1;
-
-               // Eww, do a 2d array merge so we don't wipe out settings
-               if ( $wgMetrolookFeatures ) {
-                       foreach ( $features as $name => $settings ) {
-                               if ( isset( $wgMetrolookFeatures[$name] ) ) {
-                                       $wgMetrolookFeatures[$name] += 
$settings;
-                               } else {
-                                       $wgMetrolookFeatures[$name] = $settings;
-                               }
-                       }
-               } else {
-                       $wgMetrolookFeatures = $features;
-               }
-
-       }
-
        /**
         * Checks if a certain option is enabled
         *
diff --git a/skin.json b/skin.json
index 2431eaa..b867cee 100644
--- a/skin.json
+++ b/skin.json
@@ -12,7 +12,9 @@
        "descriptionmsg": "metrolook-desc",
        "license-name": "GPL-2.0+",
        "type": "skin",
-       "callback": "MetrolookHooks::onRegistration",
+       "DefaultUserOptions": {
+               "skinmetrolook-collapsiblenav": 1
+       },
        "ConfigRegistry": {
                "metrolook": "GlobalVarConfig::newInstance"
        },
@@ -129,6 +131,13 @@
                }
        },
        "config": {
+               "MetrolookFeatures": {
+                       "collapsiblenav": {
+                               "global": false,
+                               "user": true
+                       },
+                       "_merge_strategy": "array_plus_2d"
+               },
                "MetrolookUseSimpleSearch": true,
                "MetrolookUseIconWatch": true,
                "MetrolookLogo": true,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1bd963532a5b341eab756b60bce65ae359c3d943
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/skins/Metrolook
Gerrit-Branch: master
Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com>
Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to