From e6b8b57d9b0df628aa912c7e4f54990652d221be Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sat, 1 Aug 2015 01:44:33 -0700 Subject: [PATCH] Set up "Gadget" and "Gadget definition" namespaces Register the "Gadget", "Gadget definition", and their respective talk namespaces. It will not be possible to create any pages in the Gadget and Gadget definition namespaces due to the "gadgets-edit" and "gadgets- definition-edit" rights not being granted to any groups. Depends on Iaf8b44d02adf9 in MediaWiki core. Change-Id: Ia88c774cc0decc252a4a4277d14822048db95801 --- Gadgets.namespaces.php | 17 +++++++++++++++++ extension.json | 32 +++++++++++++++++++++++++++++++- i18n/en.json | 6 +++++- i18n/qqq.json | 6 +++++- 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 Gadgets.namespaces.php diff --git a/Gadgets.namespaces.php b/Gadgets.namespaces.php new file mode 100644 index 00000000..0ec7d10d --- /dev/null +++ b/Gadgets.namespaces.php @@ -0,0 +1,17 @@ + 'Gadget', + NS_GADGET_TALK => 'Gadget_talk', + NS_GADGET_DEFINITION => 'Gadget_definition', + NS_GADGET_DEFINITION_TALK => 'Gadget_definition_talk', +); diff --git a/extension.json b/extension.json index 09ccba25..423861d0 100755 --- a/extension.json +++ b/extension.json @@ -8,6 +8,35 @@ "descriptionmsg": "gadgets-desc", "license-name": "GPL-2.0+", "type": "other", + "namespaces": [ + { + "id": 2300, + "constant": "NS_GADGET", + "name": "Gadget", + "protection": "gadgets-edit" + }, + { + "id": 2301, + "constant": "NS_GADGET_TALK", + "name": "Gadget_talk" + }, + { + "id": 2302, + "constant": "NS_GADGET_DEFINITION", + "name": "Gadget_definition", + "protection": "gadgets-definition-edit", + "capitallinkoverride": false + }, + { + "id": 2303, + "constant": "NS_GADGET_DEFINITION_TALK", + "name": "Gadget_definition_talk" + } + ], + "AvailableRights": [ + "gadgets-edit", + "gadgets-definition-edit" + ], "SpecialPages": { "Gadgets": "SpecialGadgets" }, @@ -21,7 +50,8 @@ ] }, "ExtensionMessagesFiles": { - "GadgetsAlias": "Gadgets.alias.php" + "GadgetsAlias": "Gadgets.alias.php", + "GadgetsNamespaces": "Gadgets.namespaces.php" }, "AutoloadClasses": { "ApiQueryGadgetCategories": "api/ApiQueryGadgetCategories.php", diff --git a/i18n/en.json b/i18n/en.json index 7f14d624..e2b2cae4 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -35,5 +35,9 @@ "apihelp-query+gadgets-example-2": "Get a list of gadgets with all possible properties", "apihelp-query+gadgets-example-3": "Get a list of gadgets belonging to category \"foo\"", "apihelp-query+gadgets-example-4": "Get information about gadgets \"foo\" and \"bar\"", - "apihelp-query+gadgets-example-5": "Get a list of gadgets enabled by current user" + "apihelp-query+gadgets-example-5": "Get a list of gadgets enabled by current user", + "right-gadgets-edit": "Edit gadget JavaScript and CSS pages", + "action-gadgets-edit": "edit this gadget JavaScript or CSS page", + "right-gadgets-definition-edit": "Edit gadget definitions", + "action-gadgets-definition-edit": "edit this gadget definition" } diff --git a/i18n/qqq.json b/i18n/qqq.json index 9fe59aea..dc221922 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -46,5 +46,9 @@ "apihelp-query+gadgets-example-2": "{{doc-apihelp-example|query+gadgets}}", "apihelp-query+gadgets-example-3": "{{doc-apihelp-example|query+gadgets}}", "apihelp-query+gadgets-example-4": "{{doc-apihelp-example|query+gadgets}}", - "apihelp-query+gadgets-example-5": "{{doc-apihelp-example|query+gadgets}}" + "apihelp-query+gadgets-example-5": "{{doc-apihelp-example|query+gadgets}}", + "right-gadgets-edit": "{{doc-right|gadgets-edit}}", + "action-gadgets-edit": "{{doc-action|gadgets-edit}}", + "right-gadgets-definition-edit": "{{doc-right|gadgets-definition-edit}}", + "action-gadgets-definition-edit": "{{doc-action|gadgets-definition-edit}}" }