(bug 18062) new message when edit or create the local page of a shared
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 31 Mar 2012 14:17:10 +0000 (16:17 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Sat, 31 Mar 2012 14:17:10 +0000 (16:17 +0200)
file

Change-Id: I2b7f76bd759b815a87b306fd97a97097b4731f8d

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

index 5e42184..b358e79 100644 (file)
@@ -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.
index 31e6626..052a783 100644 (file)
@@ -1634,6 +1634,24 @@ class EditPage {
                if ( $namespace == NS_MEDIAWIKI ) {
                        # Show a warning if editing an interface message
                        $wgOut->wrapWikiMsg( "<div class='mw-editinginterface'>\n$1\n</div>", '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( "<div class=\"mw-sharedupload-desc-create\">\n$1\n</div>", array (
+                                                                       'sharedupload-desc-create', $file->getRepo()->getDisplayName(), $descUrl
+                                               ) );
+                                       } else {
+                                               $wgOut->wrapWikiMsg( "<div class=\"mw-sharedupload-desc-edit\">\n$1\n</div>", 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
index 2f3cc12..e169e72 100644 (file)
@@ -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].',
index 0f57a4e..4eb4b0d 100644 (file)
@@ -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}}",
index b889a52..e9a7723 100644 (file)
@@ -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',