Pwirth has uploaded a new change for review.

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

Change subject: BSSkin: Used callback in extension.json
......................................................................

BSSkin: Used callback in extension.json

Change-Id: I5cc4b8d0783e59c99496b352cf8ae7c3bb47e6d3
---
M BlueSpiceSkin.php
M includes/BlueSpiceSkinHooks.php
M skin.json
3 files changed, 25 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/BlueSpiceSkin 
refs/changes/07/310807/1

diff --git a/BlueSpiceSkin.php b/BlueSpiceSkin.php
index 5b12cae..0714c86 100644
--- a/BlueSpiceSkin.php
+++ b/BlueSpiceSkin.php
@@ -12,22 +12,4 @@
        die("This is an extension to the MediaWiki package and cannot be run 
standalone.");
 }
 
-wfLoadSkin( 'BlueSpiceSkin' );
-
-$wgValidSkinNames['bluespiceskin'] = 'BlueSpiceSkin';
-
-//TODO: Move to Foundation and use API instead.
-$wgAjaxExportList[] = 'BlueSpiceSkinHooks::ajaxGetDiscussionCount';
-
-$wgDefaultSkin = 'bluespiceskin';
-$wgSkipSkins = array(
-       'chick',
-       'cologneblue',
-       'common',
-       'modern',
-       'monobook',
-       'myskin',
-       'nostalgia',
-       'simple',
-       'standard'
-);
+wfLoadSkin( 'BlueSpiceSkin' );
\ No newline at end of file
diff --git a/includes/BlueSpiceSkinHooks.php b/includes/BlueSpiceSkinHooks.php
index a75221f..6d4505a 100644
--- a/includes/BlueSpiceSkinHooks.php
+++ b/includes/BlueSpiceSkinHooks.php
@@ -13,6 +13,29 @@
        }
 
        /**
+        * extension.json callback
+        */
+       public static function onRegistration() {
+               $GLOBALS['wgValidSkinNames']['bluespiceskin'] = 'BlueSpiceSkin';
+
+               //TODO: Move to Foundation and use API instead.
+               $GLOBALS['wgAjaxExportList'][] = 
'BlueSpiceSkinHooks::ajaxGetDiscussionCount';
+
+               $GLOBALS['wgDefaultSkin'] = 'bluespiceskin';
+               $GLOBALS['wgSkipSkins'] = array(
+                       'chick',
+                       'cologneblue',
+                       'common',
+                       'modern',
+                       'monobook',
+                       'myskin',
+                       'nostalgia',
+                       'simple',
+                       'standard'
+               );
+       }
+
+       /**
         *
         * @param StateBar $oStatebar
         * @param array $aTopViews
diff --git a/skin.json b/skin.json
index 9ab554b..138dff2 100644
--- a/skin.json
+++ b/skin.json
@@ -28,6 +28,7 @@
        "ExtensionFunctions": [
                "BlueSpiceSkinHooks::setup"
        ],
+       "callback": "BlueSpiceSkinHooks::onRegistration",
        "ValidSkinNames": {
                "bluespiceskin": "BlueSpiceSkin"
        },

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5cc4b8d0783e59c99496b352cf8ae7c3bb47e6d3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSpiceSkin
Gerrit-Branch: master
Gerrit-Owner: Pwirth <wi...@hallowelt.biz>

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

Reply via email to