From 55d592bc2b212349ee78edfc7b3bb8c9909d4e76 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 31 Mar 2012 16:17:10 +0200 Subject: [PATCH] (bug 18062) new message when edit or create the local page of a shared file Change-Id: I2b7f76bd759b815a87b306fd97a97097b4731f8d --- RELEASE-NOTES-1.20 | 1 + includes/EditPage.php | 18 ++++++++++++++++++ languages/messages/MessagesEn.php | 4 ++++ languages/messages/MessagesQqq.php | 2 ++ maintenance/language/messages.inc | 2 ++ 5 files changed, 27 insertions(+) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index 5e42184611..b358e79ac6 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -25,6 +25,7 @@ production. * Introduce a cryptographic random number generator source api for use when 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 fixes in 1.20 === * (bug 30245) Use the correct way to construct a log page title. diff --git a/includes/EditPage.php b/includes/EditPage.php index 31e66267a5..052a7834d4 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1634,6 +1634,24 @@ class EditPage { if ( $namespace == NS_MEDIAWIKI ) { # Show a warning if editing an interface message $wgOut->wrapWikiMsg( "
\n$1\n
", 'editinginterface' ); + } else if( $namespace == NS_FILE ) { + # Show a hint to shared repo + $file = wfFindFile( $this->mTitle ); + if( $file && !$file->isLocal() ) { + $descUrl = $file->getDescriptionUrl(); + # there must be a description url to show a hint to shared repo + if( $descUrl ) { + if( !$this->mTitle->exists() ) { + $wgOut->wrapWikiMsg( "
\n$1\n
", array ( + 'sharedupload-desc-create', $file->getRepo()->getDisplayName(), $descUrl + ) ); + } else { + $wgOut->wrapWikiMsg( "
\n$1\n
", array( + 'sharedupload-desc-edit', $file->getRepo()->getDisplayName(), $descUrl + ) ); + } + } + } } # Show a warning message when someone creates/edits a user (talk) page but the user does not exist diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 2f3cc1215a..e169e7225d 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2404,6 +2404,10 @@ A [[Special:WhatLinksHere/$2|full list]] is available.', Please see the [$2 file description page] for further information.', 'sharedupload-desc-here' => 'This file is from $1 and may be used by other projects. The description on its [$2 file description page] there is shown below.', +'sharedupload-desc-edit' => 'This file is from $1 and may be used by other projects. +Maybe you want edit the description on its [$2 file description page] there.', +'sharedupload-desc-create' => 'This file is from $1 and may be used by other projects. +Maybe you want edit the description on its [$2 file description page] there.', 'shareddescriptionfollows' => '-', # do not translate or duplicate this message to other languages 'filepage-nofile' => 'No file by this name exists.', 'filepage-nofile-link' => 'No file by this name exists, but you can [$1 upload it].', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 0f57a4e505..4eb4b0dbce 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -2066,6 +2066,8 @@ Example: [[:Image:Addon-icn.png]]', {{doc-important|Do not customise this message. Just translate it.|Customisation should be done by local wikis.}}', 'sharedupload-desc-there' => ':See also: {{msg-mw|Sharedupload}}', 'sharedupload-desc-here' => ':See also: {{msg-mw|Sharedupload}}', +'sharedupload-desc-edit' => ':See also: {{msg-mw|Sharedupload}}', +'sharedupload-desc-create' => ':See also: {{msg-mw|Sharedupload}}', 'filepage-nofile' => "This message appears when visiting a File page for which there's no file, if the user cannot upload files, or file uploads are disabled. (Otherwise, see {{msg-mw|Filepage-nofile-link}}) Filepage-nofile and Filepage-nofile-link message deprecate {{msg-mw|Noimage}}", diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index b889a52b76..e9a7723630 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1494,6 +1494,8 @@ $wgMessageStructure = array( 'sharedupload', 'sharedupload-desc-there', 'sharedupload-desc-here', + 'sharedupload-desc-edit', + 'sharedupload-desc-create', 'shareddescriptionfollows', 'filepage-nofile', 'filepage-nofile-link', -- 2.20.1