[MediaWiki-commits] [Gerrit] mediawiki...BlueSpicePageAssignments[master]: WikiAdmin is not part of BlueSpice 3. Removed unneeded code and

2018-01-18 Thread Robert Vogel (Code Review)
Robert Vogel has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/404966 )

Change subject: WikiAdmin is not part of BlueSpice 3. Removed unneeded code and
..


WikiAdmin is not part of BlueSpice 3. Removed unneeded code and

used new registry for admin tools.

runPreferencePlugin:
use getConfig()->get( 'UIPermissionBlacklist' ) instead of
WikiAdmin::get( 'ExcludeRights' )

Change-Id: Icf42f3dbf1c02d7b635b577650d7d2ecfabdc282
---
M PageAssignments.class.php
M extension.json
M includes/PageAssignmentsHooks.php
A src/AdminTool.php
4 files changed, 44 insertions(+), 19 deletions(-)

Approvals:
  Robert Vogel: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/PageAssignments.class.php b/PageAssignments.class.php
index 853c74a..8eafcab 100644
--- a/PageAssignments.class.php
+++ b/PageAssignments.class.php
@@ -138,7 +138,7 @@
public function runPreferencePlugin( $sAdapterName, $oVariable ) {
$aPermissions = array_diff(
User::getAllRights(),
-   WikiAdmin::get( 'ExcludeRights' )
+   $this->getConfig()->get( 'UIPermissionBlacklist' )
);
return array(
'type' => 'multiselectex',
diff --git a/extension.json b/extension.json
index 7497f58..a93369b 100644
--- a/extension.json
+++ b/extension.json
@@ -16,6 +16,9 @@
}
},
"callback": "PageAssignments::onRegistration",
+   "BlueSpiceFoundationAdminToolRegistry": {
+   "bs-pageassignments-manager": "BS\\PageAssignments\\AdminTool"
+   },
"DefaultUserOptions": {
"echo-subscriptions-web-bs-pageassignments-action-cat": true,
"echo-subscriptions-email-bs-pageassignments-action-cat": true
@@ -175,7 +178,6 @@
"BSStateBarBeforeBodyViewAdd": 
"PageAssignmentsStateBarHooks::onStateBarBeforeBodyViewAdd",
"BSStatebarAddSortTopVars": 
"PageAssignmentsStateBarHooks::onStatebarAddSortTopVars",
"BSStatebarAddSortBodyVars": 
"PageAssignmentsStateBarHooks::onStatebarAddSortBodyVars",
-   "BSWikiAdminMenuItems": 
"PageAssignmentsHooks::onBSWikiAdminMenuItems",
"PageContentSaveComplete": 
"PageAssignmentsNotificationHooks::onPageContentSaveComplete",
"BSUserManagerAfterSetGroups": 
"PageAssignmentsNotificationHooks::onBSUserManagerAfterSetGroups",
"UserAddGroup": 
"PageAssignmentsUsersAdditionalPermissionsHooks::onUserAddGroup",
diff --git a/includes/PageAssignmentsHooks.php 
b/includes/PageAssignmentsHooks.php
index 6cacf87..aedc662 100644
--- a/includes/PageAssignmentsHooks.php
+++ b/includes/PageAssignmentsHooks.php
@@ -37,23 +37,6 @@
return true;
}
 
-   /**
-*
-* @param array $aOut
-* @param \User The user in which context the menu is rendered
-* @return boolean
-*/
-   public static function onBSWikiAdminMenuItems( &$aOut, $oUser ){
-   if( !$oUser->isAllowed( 'pageassignments' ) ) {
-   return true;
-   }
-   $sLabel = wfMessage( 'managepageassignments' )->plain();
-   $aOut[$sLabel] = Html::rawElement( 'li', array(),
-   Linker::link( SpecialPage::getTitleFor( 
'ManagePageAssignments' ), $sLabel, array( 'class' => 'bs-admin-link 
bs-icon-profile' )  )
-   );
-   return true;
-   }
-
public static function onPersonalUrls( &$aPersonal_urls, &$oTitle ) {
$oUser = RequestContext::getMain()->getUser();
if ( $oUser->isLoggedIn() ) {
diff --git a/src/AdminTool.php b/src/AdminTool.php
new file mode 100644
index 000..d302116
--- /dev/null
+++ b/src/AdminTool.php
@@ -0,0 +1,40 @@
+getLocalURL();
+   }
+
+   public function getDescription() {
+   return wfMessage( 'bs-pageassignments-desc' );
+   }
+
+   public function getName() {
+   return wfMessage( 'managepageassignments' );
+   }
+
+   public function getClasses() {
+   $classes = array(
+   'bs-admin-link bs-icon-profile'
+   );
+
+   return $classes;
+   }
+
+   public function getDataAttributes() {
+   }
+
+   public function getPermissions() {
+   $permissions = array(
+   'pageassignments'
+   );
+   return $permissions;
+   }
+
+}
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icf42f3dbf1c02d7b635b577650d7d2ecfabdc282
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpicePageAssignments
Gerrit-Branch: master

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpicePageAssignments[master]: WikiAdmin is not part of BlueSpice 3. Removed unneeded code and

2018-01-18 Thread Dvogel hallowelt (Code Review)
Dvogel hallowelt has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404966 )

Change subject: WikiAdmin is not part of BlueSpice 3. Removed unneeded code and
..

WikiAdmin is not part of BlueSpice 3. Removed unneeded code and

used new registry for admin tools.

runPreferencePlugin:
use getConfig()->get( 'UIPermissionBlacklist' ) instead of
WikiAdmin::get( 'ExcludeRights' )

Change-Id: Icf42f3dbf1c02d7b635b577650d7d2ecfabdc282
---
M PageAssignments.class.php
M extension.json
M includes/PageAssignmentsHooks.php
A src/AdminTool.php
4 files changed, 44 insertions(+), 19 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpicePageAssignments 
refs/changes/66/404966/1

diff --git a/PageAssignments.class.php b/PageAssignments.class.php
index 853c74a..8eafcab 100644
--- a/PageAssignments.class.php
+++ b/PageAssignments.class.php
@@ -138,7 +138,7 @@
public function runPreferencePlugin( $sAdapterName, $oVariable ) {
$aPermissions = array_diff(
User::getAllRights(),
-   WikiAdmin::get( 'ExcludeRights' )
+   $this->getConfig()->get( 'UIPermissionBlacklist' )
);
return array(
'type' => 'multiselectex',
diff --git a/extension.json b/extension.json
index 7497f58..a93369b 100644
--- a/extension.json
+++ b/extension.json
@@ -16,6 +16,9 @@
}
},
"callback": "PageAssignments::onRegistration",
+   "BlueSpiceFoundationAdminToolRegistry": {
+   "bs-pageassignments-manager": "BS\\PageAssignments\\AdminTool"
+   },
"DefaultUserOptions": {
"echo-subscriptions-web-bs-pageassignments-action-cat": true,
"echo-subscriptions-email-bs-pageassignments-action-cat": true
@@ -175,7 +178,6 @@
"BSStateBarBeforeBodyViewAdd": 
"PageAssignmentsStateBarHooks::onStateBarBeforeBodyViewAdd",
"BSStatebarAddSortTopVars": 
"PageAssignmentsStateBarHooks::onStatebarAddSortTopVars",
"BSStatebarAddSortBodyVars": 
"PageAssignmentsStateBarHooks::onStatebarAddSortBodyVars",
-   "BSWikiAdminMenuItems": 
"PageAssignmentsHooks::onBSWikiAdminMenuItems",
"PageContentSaveComplete": 
"PageAssignmentsNotificationHooks::onPageContentSaveComplete",
"BSUserManagerAfterSetGroups": 
"PageAssignmentsNotificationHooks::onBSUserManagerAfterSetGroups",
"UserAddGroup": 
"PageAssignmentsUsersAdditionalPermissionsHooks::onUserAddGroup",
diff --git a/includes/PageAssignmentsHooks.php 
b/includes/PageAssignmentsHooks.php
index 6cacf87..aedc662 100644
--- a/includes/PageAssignmentsHooks.php
+++ b/includes/PageAssignmentsHooks.php
@@ -37,23 +37,6 @@
return true;
}
 
-   /**
-*
-* @param array $aOut
-* @param \User The user in which context the menu is rendered
-* @return boolean
-*/
-   public static function onBSWikiAdminMenuItems( &$aOut, $oUser ){
-   if( !$oUser->isAllowed( 'pageassignments' ) ) {
-   return true;
-   }
-   $sLabel = wfMessage( 'managepageassignments' )->plain();
-   $aOut[$sLabel] = Html::rawElement( 'li', array(),
-   Linker::link( SpecialPage::getTitleFor( 
'ManagePageAssignments' ), $sLabel, array( 'class' => 'bs-admin-link 
bs-icon-profile' )  )
-   );
-   return true;
-   }
-
public static function onPersonalUrls( &$aPersonal_urls, &$oTitle ) {
$oUser = RequestContext::getMain()->getUser();
if ( $oUser->isLoggedIn() ) {
diff --git a/src/AdminTool.php b/src/AdminTool.php
new file mode 100644
index 000..d302116
--- /dev/null
+++ b/src/AdminTool.php
@@ -0,0 +1,40 @@
+getLocalURL();
+   }
+
+   public function getDescription() {
+   return wfMessage( 'bs-pageassignments-desc' );
+   }
+
+   public function getName() {
+   return wfMessage( 'managepageassignments' );
+   }
+
+   public function getClasses() {
+   $classes = array(
+   'bs-admin-link bs-icon-profile'
+   );
+
+   return $classes;
+   }
+
+   public function getDataAttributes() {
+   }
+
+   public function getPermissions() {
+   $permissions = array(
+   'pageassignments'
+   );
+   return $permissions;
+   }
+
+}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf42f3dbf1c02d7b635b577650d7d2ecfabdc282
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpicePageAssignments