ItSpiderman has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/362179 )
Change subject: NamespaceManager: Disable deleting and renaming Talk namespaces
......................................................................
NamespaceManager: Disable deleting and renaming Talk namespaces
Disabled deleting of Talk namespaces.
Disabled editing the name of Talk namespace
When user changes the name of Talk namespace its changed to normal NS and
new talk namespace for it is created, which deletes original talk
namespace
Change-Id: I7aab6e528476b44cd17d19c0c2ebc8dd9eb6bf94
ERM: #6450
---
M NamespaceManager/extension.json
M NamespaceManager/i18n/de.json
M NamespaceManager/i18n/en.json
M NamespaceManager/includes/api/BSApiNamespaceTasks.php
M NamespaceManager/includes/specials/SpecialNamespaceManager.class.php
M NamespaceManager/resources/BS.NamespaceManager/NamespaceDialog.js
6 files changed, 36 insertions(+), 12 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions
refs/changes/79/362179/1
diff --git a/NamespaceManager/extension.json b/NamespaceManager/extension.json
index c7f2c53..f89693c 100644
--- a/NamespaceManager/extension.json
+++ b/NamespaceManager/extension.json
@@ -69,7 +69,8 @@
"bs-namespacemanager-pagepresent",
"bs-namespacemanager-label-editable",
"bs-ns_main",
- "bs-from-something"
+ "bs-from-something",
+ "bs-namespacemanager-label-istalk"
]
}
},
diff --git a/NamespaceManager/i18n/de.json b/NamespaceManager/i18n/de.json
index a04fc59..cd5e570 100644
--- a/NamespaceManager/i18n/de.json
+++ b/NamespaceManager/i18n/de.json
@@ -52,5 +52,8 @@
"apihelp-bs-namespace-tasks-description": "Ermöglicht die
Namensraumkonfiguration zu verändern.",
"apihelp-bs-namespace-tasks-summary": "Erlaubt die Veränderung der
Namensraumkonfiguration.",
"action-namespacemanager-viewspecialpage": "die Spezialseite zur
Namensraumverwaltung anzusehen",
- "namespacemanager": "Namensraumverwaltung"
+ "namespacemanager": "Namensraumverwaltung",
+ "bs-namespacemanager-nodeletetalk": "Sie können einer Diskussion
Namensraum löschen nicht!",
+ "bs-namespacemanager-noedittalkname": "Sie können der Name von
Diskussion Namensraum ändern",
+ "bs-namespacemanager-label-istalk": "Diskussion"
}
diff --git a/NamespaceManager/i18n/en.json b/NamespaceManager/i18n/en.json
index 26d0f85..50420c3 100644
--- a/NamespaceManager/i18n/en.json
+++ b/NamespaceManager/i18n/en.json
@@ -49,5 +49,8 @@
"apihelp-bs-namespace-tasks-description": "Allows modification of the
namespace configuration.",
"apihelp-bs-namespace-tasks-summary": "Allows modification of the
namespace configuration.",
"action-namespacemanager-viewspecialpage": "view specialpage of
namespace manager",
- "namespacemanager": "Namespace manager"
+ "namespacemanager": "Namespace manager",
+ "bs-namespacemanager-nodeletetalk": "Talk namespace cannot be deleted",
+ "bs-namespacemanager-noedittalkname": "Name of the Talk namespace
cannot be changed",
+ "bs-namespacemanager-label-istalk": "Talk"
}
\ No newline at end of file
diff --git a/NamespaceManager/includes/api/BSApiNamespaceTasks.php
b/NamespaceManager/includes/api/BSApiNamespaceTasks.php
index 360dc62..df750e3 100644
--- a/NamespaceManager/includes/api/BSApiNamespaceTasks.php
+++ b/NamespaceManager/includes/api/BSApiNamespaceTasks.php
@@ -179,6 +179,11 @@
global $bsSystemNamespaces, $wgContLang;
+ if ( strstr( $sNamespace, '_'.$wgContLang->getNsText( NS_TALK )
) ) {
+ $oResult->message = wfMessage(
'bs-namespacemanager-noedittalkname' )->plain();
+ return $oResult;
+ }
+
$oNamespaceManager = BsExtensionManager::getExtension(
'NamespaceManager' );
Hooks::run( 'BSNamespaceManagerBeforeSetUsernamespaces', array(
$oNamespaceManager, &$bsSystemNamespaces ) );
$aUserNamespaces = NamespaceManager::getUserNamespaces( true );
@@ -272,11 +277,14 @@
$aNamespacesToRemove = array( array( $iNS, 0 ) );
$sOriginalNamespace = $sNamespace = $aUserNamespaces[ $iNS ][
'name' ];
- if ( !strstr( $sNamespace, '_'.$wgContLang->getNsText( NS_TALK
) ) ) {
- if ( isset( $aUserNamespaces[ ($iNS + 1) ] ) && strstr(
$aUserNamespaces[ ($iNS + 1) ][ 'name' ], '_'.$wgContLang->getNsText( NS_TALK )
) ) {
- $aNamespacesToRemove[] = array( ($iNS + 1), 1 );
- $sNamespace = $aUserNamespaces[ ($iNS + 1) ][
'name' ];
- }
+ if ( strstr( $sNamespace, '_'.$wgContLang->getNsText( NS_TALK )
) ) {
+ $oResult->message = wfMessage(
'bs-namespacemanager-nodeletetalk' )->plain();
+ return $oResult;
+ }
+
+ if ( isset( $aUserNamespaces[ ($iNS + 1) ] ) && strstr(
$aUserNamespaces[ ($iNS + 1) ][ 'name' ], '_'.$wgContLang->getNsText( NS_TALK )
) ) {
+ $aNamespacesToRemove[] = array( ($iNS + 1), 1 );
+ $sNamespace = $aUserNamespaces[ ($iNS + 1) ][ 'name' ];
}
$bErrors = false;
diff --git
a/NamespaceManager/includes/specials/SpecialNamespaceManager.class.php
b/NamespaceManager/includes/specials/SpecialNamespaceManager.class.php
index fd718f4..1e5de33 100644
--- a/NamespaceManager/includes/specials/SpecialNamespaceManager.class.php
+++ b/NamespaceManager/includes/specials/SpecialNamespaceManager.class.php
@@ -55,6 +55,16 @@
),
),
array(
+ 'name' => 'isTalkNS',
+ 'type' => 'boolean',
+ 'label' => wfMessage(
'bs-namespacemanager-label-istalk' )->plain(),
+ 'hidden' => true,
+ 'sortable' => true,
+ 'filter' => array(
+ 'type' => 'bool'
+ ),
+ ),
+ array(
'name' => 'subpages',
'type' => 'boolean',
'label' => wfMessage(
'bs-namespacemanager-label-subpages' )->plain(),
diff --git a/NamespaceManager/resources/BS.NamespaceManager/NamespaceDialog.js
b/NamespaceManager/resources/BS.NamespaceManager/NamespaceDialog.js
index 9e58ea9..fe441e0 100644
--- a/NamespaceManager/resources/BS.NamespaceManager/NamespaceDialog.js
+++ b/NamespaceManager/resources/BS.NamespaceManager/NamespaceDialog.js
@@ -58,12 +58,11 @@
},
setData: function( obj ) {
this.currentData = obj;
-
- if(!this.currentData.isSystemNS) {
- this.tfNamespaceName.enable();
+ if( this.currentData.isSystemNS || this.currentData.isTalkNS) {
+ this.tfNamespaceName.disable();
}
else {
- this.tfNamespaceName.disable();
+ this.tfNamespaceName.enable();
}
this.tfNamespaceName.setValue( this.currentData.name );
--
To view, visit https://gerrit.wikimedia.org/r/362179
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7aab6e528476b44cd17d19c0c2ebc8dd9eb6bf94
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: ItSpiderman <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits