Ljonka has uploaded a new change for review.
https://gerrit.wikimedia.org/r/304007
Change subject: GroupManager: move to special page and register own permission
......................................................................
GroupManager: move to special page and register own permission
Change-Id: I266ef4bc918824e44f2cd18c206b326fd61a5df9
---
M GroupManager/GroupManager.class.php
M GroupManager/GroupManager.setup.php
M GroupManager/i18n/en.json
M GroupManager/i18n/qqq.json
A GroupManager/includes/specials/SpecialGroupManager.alias.php
A GroupManager/includes/specials/SpecialGroupManager.class.php
6 files changed, 69 insertions(+), 4 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions
refs/changes/07/304007/1
diff --git a/GroupManager/GroupManager.class.php
b/GroupManager/GroupManager.class.php
index 81628d7..95dbeed 100644
--- a/GroupManager/GroupManager.class.php
+++ b/GroupManager/GroupManager.class.php
@@ -67,6 +67,12 @@
wfProfileOut( 'BS::'.__METHOD__ );
}
+ protected function initExt() {
+ wfProfileIn( 'BS::'.__METHOD__ );
+ $this->mCore->registerPermission(
'groupmanager-viewspecialpage', array('sysop'), array( 'type' => 'global' ) );
+ wfProfileOut( 'BS::'.__METHOD__ );
+ }
+
/**
* offers the formular for the group manager
* @return string the formular code
diff --git a/GroupManager/GroupManager.setup.php
b/GroupManager/GroupManager.setup.php
index bd3b1ca..1b734d6 100644
--- a/GroupManager/GroupManager.setup.php
+++ b/GroupManager/GroupManager.setup.php
@@ -4,6 +4,9 @@
$wgAutoloadClasses['GroupManager'] = __DIR__ . '/GroupManager.class.php';
$wgAutoloadClasses['BSApiTasksGroupManager'] = __DIR__ .
'/includes/api/BSApiTasksGroupManager.php';
+$wgAutoloadClasses['SpecialGroupManager'] = __DIR__ .
'/includes/specials/SpecialGroupManager.class.php';
+$wgExtensionMessagesFiles['SpecialGroupManagerAlias'] = __DIR__ .
'/includes/specials/SpecialGroupManager.alias.php';
+$wgSpecialPages['GroupManager'] = 'SpecialGroupManager';
$wgMessagesDirs['GroupManager'] = __DIR__ . '/i18n';
diff --git a/GroupManager/i18n/en.json b/GroupManager/i18n/en.json
index 157f0fc..95aad32 100644
--- a/GroupManager/i18n/en.json
+++ b/GroupManager/i18n/en.json
@@ -1,7 +1,8 @@
{
"@metadata": {
"authors": [
- "Stephan Muggli <[email protected]>"
+ "Stephan Muggli <[email protected]>",
+ "Leonid Verhovskij <[email protected]>"
]
},
"bs-groupmanager-desc": "Administration interface for adding, editing
and deleting user groups and their rights",
@@ -31,5 +32,7 @@
"logentry-bs-group-manager-create": "$1 {{GENDER:$2|has created}} the
group $4",
"logentry-bs-group-manager-modify": "$1 {{GENDER:$2|has renamed}} the
group $4 to $5",
"logentry-bs-group-manager-remove": "$1 {{GENDER:$2|has removed}} the
group $4",
- "apihelp-bs-groupmanager-description": "Provides the tasks for the
extension GroupManager."
+ "apihelp-bs-groupmanager-description": "Provides the tasks for the
extension GroupManager.",
+ "action-groupmanager-viewspecialpage": "view the special page
\"{{int:bs-groupmanager-label}}\"",
+ "groupmanager":"Group manager"
}
diff --git a/GroupManager/i18n/qqq.json b/GroupManager/i18n/qqq.json
index 859acf7..c31fe5c 100644
--- a/GroupManager/i18n/qqq.json
+++ b/GroupManager/i18n/qqq.json
@@ -3,7 +3,8 @@
"authors": [
"Stephan Muggli <[email protected]>",
"Liuxinyu970226",
- "Shirayuki"
+ "Shirayuki",
+ "Leonid Verhovskij <[email protected]>"
]
},
"bs-groupmanager-desc": "Used in
[{{canonicalurl:Special:WikiAdmin|mode=ExtensionInfo}}
Special:WikiAdmin?mode=ExtensionInfo], description of group manager extension",
@@ -33,5 +34,7 @@
"logentry-bs-group-manager-create": "Log message about the creation of
a new group.\nParameters:\n* $4 - name of the group",
"logentry-bs-group-manager-modify": "Log message about changes of the
name of a group.\nParameters:\n* $4 - old name of the group\n* $5 - new name of
the group",
"logentry-bs-group-manager-remove": "Log message about the removal of a
group.\nParameters:\n* $4 - name of the group",
- "apihelp-bs-groupmanager-description": "Describes the API endpoint that
provides tasks for the GroupManager extension"
+ "apihelp-bs-groupmanager-description": "Describes the API endpoint that
provides tasks for the GroupManager extension",
+ "action-groupmanager-viewspecialpage": "placeholder to describe that
view of special page \"{{int:bs-groupmanager-label}}\" is restricted for the
current user",
+ "groupmanager":"Used in overview of special pages, anchor text for
group manager\n{{Identical|Group manager}}"
}
diff --git a/GroupManager/includes/specials/SpecialGroupManager.alias.php
b/GroupManager/includes/specials/SpecialGroupManager.alias.php
new file mode 100644
index 0000000..d4dec01
--- /dev/null
+++ b/GroupManager/includes/specials/SpecialGroupManager.alias.php
@@ -0,0 +1,12 @@
+<?php
+$specialPageAliases = array();
+
+/** English */
+$specialPageAliases['en'] = array(
+ 'GroupManager' => array( 'GroupManager', 'Group Manager' ),
+);
+
+/** German (Deutsch) */
+$specialPageAliases['de'] = array(
+ 'GroupManager' => array( 'GroupManager', 'Group Manager',
'Gruppenverwaltung', 'Gruppenmanager' ),
+);
diff --git a/GroupManager/includes/specials/SpecialGroupManager.class.php
b/GroupManager/includes/specials/SpecialGroupManager.class.php
new file mode 100644
index 0000000..9f6dfea
--- /dev/null
+++ b/GroupManager/includes/specials/SpecialGroupManager.class.php
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * Special page for GroupManager of BlueSpice (MediaWiki)
+ *
+ * Part of BlueSpice for MediaWiki
+ *
+ * @author Leonid Verhovskij <[email protected]>
+ * @version $Id$
+ * @package BlueSpiceExtensions
+ * @subpackage GroupManager
+ * @copyright Copyright (C) 2016 Hallo Welt! GmbH, All rights reserved.
+ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or
later
+ * @filesource
+ */
+class SpecialGroupManager extends BsSpecialPage {
+
+ public function __construct() {
+ parent::__construct( 'GroupManager',
'groupmanager-viewspecialpage' );
+ }
+
+ public function execute( $par ) {
+ parent::execute( $par );
+ $oOutputPage = $this->getOutput();
+
+ $oOutputPage->setPageTitle( wfMessage( 'bs-groupmanager-label'
)->inContentLanguage() );
+
+ $this->getOutput()->addModules( 'ext.bluespice.groupManager' );
+ BsExtensionManager::setContext( 'MW::GroupManagerShow' );
+ $oOutputPage->addHTML( '<div id="bs-groupmanager-grid"></div>'
);
+
+ }
+
+ protected function getGroupName() {
+ return 'bluespice';
+ }
+
+}
--
To view, visit https://gerrit.wikimedia.org/r/304007
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I266ef4bc918824e44f2cd18c206b326fd61a5df9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Ljonka <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits