[MediaWiki-commits] [Gerrit] Add protected & semiprotected notices to api. - change (mediawiki...VisualEditor)
jenkins-bot has submitted this change and it was merged. 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(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php index 85d1ed8..ea37c9a 100644 --- a/ApiVisualEditor.php +++ b/ApiVisualEditor.php @@ -265,6 +265,16 @@ if ( $parsed && $parsed['restoring'] ) { $wgVisualEditorEditNotices[] = 'editingold'; } + // Protected page + if ( $page->getNamespace() != NS_MEDIAWIKI && $page->isProtected( 'edit' ) ) { + # Is the title semi-protected? + if ( $page->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: merged Gerrit-Change-Id: I2966a31b909e44aa371dfe84cb68c264420e35a7 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Robmoen Gerrit-Reviewer: Catrope Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add protected & semiprotected notices to api. - change (mediawiki...VisualEditor)
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 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits