Robmoen has uploaded a new change for review.
https://gerrit.wikimedia.org/r/73022
Change subject: Add protected & semiprotected notices to api.
......................................................................
Add protected & semiprotected notices to api.
Bug: 50415
Change-Id: I2966a31b909e44aa371dfe84cb68c264420e35a7
---
M ApiVisualEditor.php
1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/22/73022/1
diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php
index 85d1ed8..e621d33 100644
--- a/ApiVisualEditor.php
+++ b/ApiVisualEditor.php
@@ -265,6 +265,16 @@
if ( $parsed && $parsed['restoring'] ) {
$wgVisualEditorEditNotices[] =
'editingold';
}
+ // Protected page
+ if ( $wgTitle->getNamespace() != NS_MEDIAWIKI
&& $wgTitle->isProtected( 'edit' ) ) {
+ # Is the title semi-protected?
+ if ( $wgTitle->isSemiProtected() ) {
+ $wgVisualEditorEditNotices[]
='semiprotectedpagewarning';
+ } else {
+ # Then it must be protected
based on static groups (regular)
+ $wgVisualEditorEditNotices[]
='protectedpagewarning';
+ }
+ }
if ( count( $wgVisualEditorEditNotices ) ) {
foreach ( $wgVisualEditorEditNotices as
$key ) {
$notices[] = wfMessage( $key
)->parseAsBlock();
--
To view, visit https://gerrit.wikimedia.org/r/73022
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2966a31b909e44aa371dfe84cb68c264420e35a7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Robmoen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits