From ca9f3f983f2663ee7e48e570b7fff8a23014471c Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Thu, 12 Mar 2015 23:01:59 +0100 Subject: [PATCH] EditPage: Implement 'editnotice-notext' message Bug: T91715 Change-Id: Iff6735d93da8b877063690ff67bda652a03d4906 --- RELEASE-NOTES-1.25 | 2 ++ includes/EditPage.php | 14 +++++++++++++- languages/i18n/en.json | 1 + languages/i18n/qqq.json | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 index 5e08efdd0e..e657239f1d 100644 --- a/RELEASE-NOTES-1.25 +++ b/RELEASE-NOTES-1.25 @@ -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 diff --git a/includes/EditPage.php b/includes/EditPage.php index a8a17cf90b..e9a5ef9ed3 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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( + '
' + . $msg->parseAsBlock() + . '
' + ); + } + } if ( $this->isConflict ) { $wgOut->wrapWikiMsg( "
\n$1\n
", 'explainconflict' ); diff --git a/languages/i18n/en.json b/languages/i18n/en.json index a81a89e17a..8d98ccd3e2 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -645,6 +645,7 @@ "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.\nOnly the text in the upper text area will be saved when you press \"{{int:savearticle}}\".", "yourtext": "Your text", "storedversion": "Stored revision", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 77ecd74d0a..bd8e984aba 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -810,6 +810,7 @@ "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.", -- 2.20.1