Robert Vogel has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394052 )

Change subject: BlueSpiceDashboards: Change config
......................................................................


BlueSpiceDashboards: Change config

Added config-data in extension.json.

Removed BsConfig-Registration in main-classes.

Added Hook AddUserDashboardOnLogo.php

Fixed namespace on config-class.

Fixed path of hook.

Change-Id: I88a1749a62eb9a27b67109271cc11d372cd87db0
---
M Dashboards.class.php
M extension.json
M resources/bluespice.dashboards.main.js
A src/Hook/GetPreferences/AddUserDashboardOnLogo.php
4 files changed, 21 insertions(+), 3 deletions(-)

Approvals:
  Pwirth: Verified; Looks good to me, approved



diff --git a/Dashboards.class.php b/Dashboards.class.php
index 1c04df0..9f7eebf 100644
--- a/Dashboards.class.php
+++ b/Dashboards.class.php
@@ -41,8 +41,6 @@
        public function  initExt() {
                wfProfileIn( 'BS::'.__METHOD__ );
 
-               BsConfig::registerVar('MW::Dashboards::UserDashboardOnLogo', 
false, BsConfig::LEVEL_USER|BsConfig::TYPE_BOOL, 
'bs-dashboards-pref-userdashboardonlogo', 'toggle');
-
                $this->setHook( 'BeforePageDisplay' );
                $this->setHook( 'ParserFirstCallInit' );
                $this->setHook( 'PersonalUrls' );
diff --git a/extension.json b/extension.json
index 7b9fed9..05be913 100644
--- a/extension.json
+++ b/extension.json
@@ -29,6 +29,9 @@
                        "i18n"
                ]
        },
+       "DefaultUserOptions": {
+               "bs-dashboards-userdashboardonlogo" : false
+       },
        "ExtensionMessagesFiles": {
                "DashboardsAlias": "languages/Dashboards.alias.php"
        },
@@ -96,6 +99,7 @@
                "remoteExtPath": "BlueSpiceDashboards/resources"
        },
        "Hooks": {
+               "GetPreferences": 
"\\BlueSpice\\Dashboards\\Hook\\GetPreferences\\AddUserDashboardOnLogo::callback",
                "LoadExtensionSchemaUpdates": "Dashboards::getSchemaUpdates",
                "UnitTestsList": "Dashboards::onUnitTestsList"
        },
diff --git a/resources/bluespice.dashboards.main.js 
b/resources/bluespice.dashboards.main.js
index cc32c63..a452f38 100644
--- a/resources/bluespice.dashboards.main.js
+++ b/resources/bluespice.dashboards.main.js
@@ -1,5 +1,5 @@
 $(function(){
-       if ( mw.user.options.get( 'MW::Dashboards::UserDashboardOnLogo', false 
) == true ) {
+       if ( mw.user.options.get( 'bs-dashboards-pref-userdashboardonlogo', 
false ) == true ) {
 
                var $logoAnchor = $('#p-logo a').first(); //MediaWiki Skin
                if( $logoAnchor.length == 0 ) {
diff --git a/src/Hook/GetPreferences/AddUserDashboardOnLogo.php 
b/src/Hook/GetPreferences/AddUserDashboardOnLogo.php
new file mode 100644
index 0000000..e65e20c
--- /dev/null
+++ b/src/Hook/GetPreferences/AddUserDashboardOnLogo.php
@@ -0,0 +1,16 @@
+<?php
+
+namespace BlueSpice\Dashboards\Hook\GetPreferences;
+
+use BlueSpice\Hook\GetPreferences;
+
+class AddModus extends GetPreferences {
+       protected function doProcess() {
+               $this->preferences['bs-dashboards-pref-userdashboardonlogo'] = 
array(
+                       'type' => 'toggle',
+                       'label-message' => 
'bs-dashboards-pref-userdashboardonlogo',
+                       'section' => 'bluespice/dashboards',
+               );
+               return true;
+       }
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I88a1749a62eb9a27b67109271cc11d372cd87db0
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/BlueSpiceDashboards
Gerrit-Branch: master
Gerrit-Owner: Pmiguelpirzer <schmir...@gmail.com>
Gerrit-Reviewer: Ljonka <l.verhovs...@gmail.com>
Gerrit-Reviewer: Mglaser <gla...@hallowelt.biz>
Gerrit-Reviewer: Pwirth <wi...@hallowelt.biz>
Gerrit-Reviewer: Robert Vogel <vo...@hallowelt.biz>

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

Reply via email to