[MediaWiki-commits] [Gerrit] Add notices for pages protected from creation - change (mediawiki...VisualEditor)

2013-07-10 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add notices for pages protected from creation
..


Add notices for pages protected from creation

Change-Id: I829c104e1c62e0ad2b48d526447b1ede8408bc6f
---
M ApiVisualEditor.php
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php
index ea37c9a..fb83e1f 100644
--- a/ApiVisualEditor.php
+++ b/ApiVisualEditor.php
@@ -265,7 +265,7 @@
if ( $parsed && $parsed['restoring'] ) {
$wgVisualEditorEditNotices[] = 
'editingold';
}
-   // Protected page
+   // Page protected from editing
if ( $page->getNamespace() != NS_MEDIAWIKI && 
$page->isProtected( 'edit' ) ) {
# Is the title semi-protected?
if ( $page->isSemiProtected() ) {
@@ -275,6 +275,10 @@
$wgVisualEditorEditNotices[] = 
'protectedpagewarning';
}
}
+   // Page protected from creation
+   if ( !$page->exists() && 
$page->getRestrictions( 'create' ) ) {
+   $wgVisualEditorEditNotices[] = 
'titleprotectedwarning';
+   }
if ( count( $wgVisualEditorEditNotices ) ) {
foreach ( $wgVisualEditorEditNotices as 
$key ) {
$notices[] = wfMessage( $key 
)->parseAsBlock();

-- 
To view, visit https://gerrit.wikimedia.org/r/73043
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I829c104e1c62e0ad2b48d526447b1ede8408bc6f
Gerrit-PatchSet: 1
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 notices for pages protected from creation - change (mediawiki...VisualEditor)

2013-07-10 Thread Robmoen (Code Review)
Robmoen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/73043


Change subject: Add notices for pages protected from creation
..

Add notices for pages protected from creation

Change-Id: I829c104e1c62e0ad2b48d526447b1ede8408bc6f
---
M ApiVisualEditor.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/43/73043/1

diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php
index ea37c9a..fb83e1f 100644
--- a/ApiVisualEditor.php
+++ b/ApiVisualEditor.php
@@ -265,7 +265,7 @@
if ( $parsed && $parsed['restoring'] ) {
$wgVisualEditorEditNotices[] = 
'editingold';
}
-   // Protected page
+   // Page protected from editing
if ( $page->getNamespace() != NS_MEDIAWIKI && 
$page->isProtected( 'edit' ) ) {
# Is the title semi-protected?
if ( $page->isSemiProtected() ) {
@@ -275,6 +275,10 @@
$wgVisualEditorEditNotices[] = 
'protectedpagewarning';
}
}
+   // Page protected from creation
+   if ( !$page->exists() && 
$page->getRestrictions( 'create' ) ) {
+   $wgVisualEditorEditNotices[] = 
'titleprotectedwarning';
+   }
if ( count( $wgVisualEditorEditNotices ) ) {
foreach ( $wgVisualEditorEditNotices as 
$key ) {
$notices[] = wfMessage( $key 
)->parseAsBlock();

-- 
To view, visit https://gerrit.wikimedia.org/r/73043
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I829c104e1c62e0ad2b48d526447b1ede8408bc6f
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