mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 08:34:54 +00:00
Merge "Add protected & semiprotected notices to api."
This commit is contained in:
commit
301948184c
|
@ -265,6 +265,16 @@ class ApiVisualEditor extends ApiBase {
|
||||||
if ( $parsed && $parsed['restoring'] ) {
|
if ( $parsed && $parsed['restoring'] ) {
|
||||||
$wgVisualEditorEditNotices[] = 'editingold';
|
$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 ) ) {
|
if ( count( $wgVisualEditorEditNotices ) ) {
|
||||||
foreach ( $wgVisualEditorEditNotices as $key ) {
|
foreach ( $wgVisualEditorEditNotices as $key ) {
|
||||||
$notices[] = wfMessage( $key )->parseAsBlock();
|
$notices[] = wfMessage( $key )->parseAsBlock();
|
||||||
|
|
Loading…
Reference in a new issue