(bug 22870) Separate interface message when creating a page
authorumherirrender <umherirrender_de.wp@web.de>
Sun, 1 Apr 2012 07:40:54 +0000 (09:40 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Sun, 1 Apr 2012 07:40:54 +0000 (09:40 +0200)
Add new message 'creating' and use it for the page title of the edit
page.

Change-Id: I8435d21a3674b48ec5a14481cdacf0a52662fa1f

RELEASE-NOTES-1.20
includes/EditPage.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

index b358e79..1925d13 100644 (file)
@@ -26,6 +26,7 @@ production.
   generating various tokens.
 * (bug 30963) Option on Special:Prefixindex and Special:Allpages to not show redirects.
 * (bug 18062) new message when edit or create the local page of a shared file
+* (bug 22870) Separate interface message when creating a page
 
 === Bug fixes in 1.20 ===
 * (bug 30245) Use the correct way to construct a log page title.
index 052a783..5e3a964 100644 (file)
@@ -1603,21 +1603,21 @@ class EditPage {
                # Enabled article-related sidebar, toplinks, etc.
                $wgOut->setArticleRelated( true );
 
+               $contextTitle = $this->getContextTitle();
                if ( $this->isConflict ) {
-                       $wgOut->setPageTitle( wfMessage( 'editconflict', $this->getContextTitle()->getPrefixedText() ) );
-               } elseif ( $this->section != '' ) {
+                       $msg = 'editconflict';
+               } elseif ( $contextTitle->exists() && $this->section != '' ) {
                        $msg = $this->section == 'new' ? 'editingcomment' : 'editingsection';
-                       $wgOut->setPageTitle( wfMessage( $msg, $this->getContextTitle()->getPrefixedText() ) );
                } else {
-                       # Use the title defined by DISPLAYTITLE magic word when present
-                       if ( isset( $this->mParserOutput )
-                        && ( $dt = $this->mParserOutput->getDisplayTitle() ) !== false ) {
-                               $title = $dt;
-                       } else {
-                               $title = $this->getContextTitle()->getPrefixedText();
-                       }
-                       $wgOut->setPageTitle( wfMessage( 'editing', $title ) );
+                       $msg = $contextTitle->exists() || ( $contextTitle->getNamespace() == NS_MEDIAWIKI && $contextTitle->getDefaultMessageText() !== false ) ?\r
+                               'editing' : 'creating';\r
+               }
+               # Use the title defined by DISPLAYTITLE magic word when present
+               $displayTitle = isset( $this->mParserOutput ) ? $this->mParserOutput->getDisplayTitle() : false;\r
+               if ( $displayTitle === false ) {\r
+                       $displayTitle = $contextTitle->getPrefixedText();\r
                }
+               $wgOut->setPageTitle( wfMessage( $msg, $displayTitle ) );
        }
 
        /**
index 6186892..398e881 100644 (file)
@@ -1388,6 +1388,7 @@ The edit has been rejected to prevent corruption of the page text.
 This sometimes happens when you are using a buggy web-based anonymous proxy service.",
 'edit_form_incomplete'             => "'''Some parts of the edit form did not reach the server; double-check that your edits are intact and try again.'''",
 'editing'                          => 'Editing $1',
+'creating'                         => 'Creating $1',
 'editingsection'                   => 'Editing $1 (section)',
 'editingcomment'                   => 'Editing $1 (new section)',
 'editconflict'                     => 'Edit conflict: $1',
index 4eb4b0d..6bd933c 100644 (file)
@@ -971,6 +971,7 @@ See also {{msg-mw|Noarticletext-nopermission}}.',
 'updated'                          => '{{Identical|Updated}}',
 'previewnote'                      => 'Note displayed when clicking on Show preview',
 'editing'                          => "Shown as page title when editing a page. \$1 is the name of the page that is being edited. Example: \"''Editing Main Page''\".",
+'creating'                         => "Shown as page title when creating a page. \$1 is the name of the page that is being created. Example: \"''Creating Main Page''\".",
 'editingsection'                   => 'The variable $1 is the page name.  This message displays at the top of the page when a user is editing a page section.',
 'explainconflict'                  => 'Appears at the top of a page when there is an edit conflict.',
 'storedversion'                    => 'This is used in an edit conflict as the label for the top revision that has been stored, as opposed to your version that has not been stored which is shown at the bottom of the page.',
index 29c5c05..d88cc3f 100644 (file)
@@ -628,6 +628,7 @@ $wgMessageStructure = array(
                'token_suffix_mismatch',
                'edit_form_incomplete',
                'editing',
+               'creating',
                'editingsection',
                'editingcomment',
                'editconflict',