Revert r38879, 38880 "(bug 14002) Change cascade protection warning message to be...
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 8 Aug 2008 21:56:58 +0000 (21:56 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 8 Aug 2008 21:56:58 +0000 (21:56 +0000)
Incompatible change to message, and just seems kind of ugly. It's usually easier to maintain the core message without having to remember to slap "and the bit that always follows it" on the end every time.
Probably the other message referred to should be fixed to follow general conventions, rather than this one changed to break them. :)

includes/EditPage.php
languages/messages/MessagesEn.php

index 4406838..160e0f1 100644 (file)
@@ -1151,11 +1151,14 @@ class EditPage {
                if ( $this->mTitle->isCascadeProtected() ) {
                        # Is this page under cascading protection from some source pages?
                        list($cascadeSources, /* $restrictions */) = $this->mTitle->getCascadeProtectionSources();
-                       $notice = "";
-                       foreach( $cascadeSources as $page ) {
-                               $notice .= '* [[:' . $page->getPrefixedText() . "]]\n";
+                       $notice = "$1\n";
+                       if ( count($cascadeSources) > 0 ) {
+                               # Explain, and list the titles responsible
+                               foreach( $cascadeSources as $page ) {
+                                       $notice .= '* [[:' . $page->getPrefixedText() . "]]\n";
+                               }
                        }
-                       $wgOut->addWikiMsg( 'cascadeprotectedwarning', count($cascadeSources), $notice );
+                       $wgOut->wrapWikiMsg( $notice, array( 'cascadeprotectedwarning', count($cascadeSources) ) );
                }
                if( !$this->mTitle->exists() && $this->mTitle->getRestrictions( 'create' ) != array() ){
                        $wgOut->addWikiMsg( 'titleprotectedwarning' );
index 8c0e2ba..dc93385 100644 (file)
@@ -1150,8 +1150,7 @@ It cannot be saved.</strong>',
 You may wish to cut-n-paste the text into a text file and save it for later.</strong>',
 'protectedpagewarning'             => '<strong>WARNING: This page has been locked so that only users with sysop privileges can edit it.</strong>',
 'semiprotectedpagewarning'         => "'''Note:''' This page has been locked so that only registered users can edit it.",
-'cascadeprotectedwarning'          => "'''Warning:''' This page has been locked so that only users with sysop privileges can edit it, because it is included in the following cascade-protected {{PLURAL:$1|page|pages}}:
-$2",
+'cascadeprotectedwarning'          => "'''Warning:''' This page has been locked so that only users with sysop privileges can edit it, because it is included in the following cascade-protected {{PLURAL:$1|page|pages}}:",
 'titleprotectedwarning'            => '<strong>WARNING:  This page has been locked so that only some users can create it.</strong>',
 'templatesused'                    => 'Templates used on this page:',
 'templatesusedpreview'             => 'Templates used in this preview:',