EditPage: Implement 'editnotice-notext' message
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 12 Mar 2015 22:01:59 +0000 (23:01 +0100)
committerJames D. Forrester <jforrester@wikimedia.org>
Thu, 19 Mar 2015 02:18:36 +0000 (19:18 -0700)
Bug: T91715
Change-Id: Iff6735d93da8b877063690ff67bda652a03d4906

RELEASE-NOTES-1.25
includes/EditPage.php
languages/i18n/en.json
languages/i18n/qqq.json

index 5e08efd..e657239 100644 (file)
@@ -115,6 +115,8 @@ production.
   interface, reachable via IContextSource::getStats().
 * Move the jQuery Client library from being mastered in MediaWiki as v0.1.0 to a
   proper, published library, which is now tagged as v1.0.0.
+* A new message (defaulting to blank), 'editnotice-notext', can be shown to users
+  when they are editing if no edit notices apply to the page being edited.
 
 ==== External libraries ====
 * MediaWiki now requires certain external libraries to be installed. In the past
index a8a17cf..e9a5ef9 100644 (file)
@@ -2555,7 +2555,19 @@ class EditPage {
                }
 
                // Add edit notices
-               $wgOut->addHTML( implode( "\n", $this->mTitle->getEditNotices( $this->oldid ) ) );
+               $editNotices = $this->mTitle->getEditNotices( $this->oldid );
+               if ( count( $editNotices ) ) {
+                       $wgOut->addHTML( implode( "\n", $editNotices ) );
+               } else {
+                       $msg = wfMessage( 'editnotice-notext' );
+                       if ( !$msg->isDisabled() ) {
+                               $wgOut->addHTML(
+                                       '<div class="mw-editnotice-notext">'
+                                       . $msg->parseAsBlock()
+                                       . '</div>'
+                               );
+                       }
+               }
 
                if ( $this->isConflict ) {
                        $wgOut->wrapWikiMsg( "<div class='mw-explainconflict'>\n$1\n</div>", 'explainconflict' );
index a81a89e..8d98ccd 100644 (file)
        "editingsection": "Editing $1 (section)",
        "editingcomment": "Editing $1 (new section)",
        "editconflict": "Edit conflict: $1",
+       "editnotice-notext": "-",
        "explainconflict": "Someone else has changed this page since you started editing it.\nThe upper text area contains the page text as it currently exists.\nYour changes are shown in the lower text area.\nYou will have to merge your changes into the existing text.\n<strong>Only</strong> the text in the upper text area will be saved when you press \"{{int:savearticle}}\".",
        "yourtext": "Your text",
        "storedversion": "Stored revision",
index 77ecd74..bd8e984 100644 (file)
        "editingsection": "This message displays at the top of the page when a user is editing a page section. Parameters:\n* $1 - page name\n{{Related|Editing}}",
        "editingcomment": "This message displays at the top of the page when a user is creating a new section. Parameters:\n* $1 - page name\n{{Related|Editing}}",
        "editconflict": "Used as title of error message. Parameters:\n* $1 - page title",
+       "editnotice-notext": "{{ignored}}\nCustom message on top of the edit page if no edit notices apply to this page.",
        "explainconflict": "Appears at the top of a page when there is an edit conflict.\n\nSee also:\n* {{msg-mw|Savearticle}}",
        "yourtext": "Used in Diff Preview page. The diff is between {{msg-mw|currentrev}} and {{msg-mw|yourtext}}.\n\nAlso used in Edit Conflict page; the diff between {{msg-mw|yourtext}} and {{msg-mw|storedversion}}.",
        "storedversion": "This is used in an edit conflict as the label for the top revision that has been stored, as opposed to your version {{msg-mw|yourtext}} that has not been stored which is shown at the bottom of the page.",