* Only show dupe messages for remote images once. Twice is redundant :)
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 17 Feb 2009 21:33:12 +0000 (21:33 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 17 Feb 2009 21:33:12 +0000 (21:33 +0000)
* Phased out sharedupload(duplicate|conflict)(\-linktext)? messages (removed from en and messages.inc)

RELEASE-NOTES
includes/ImagePage.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 2a64920..d0a2e29 100644 (file)
@@ -184,6 +184,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   in next page link
 * (bug 17506) Exceptions within exceptions now respect $wgShowExceptionDetails
 * Fixed excessive job queue utilisation
+* File dupe messages for remote repos are now shown only once.
 
 == API changes in 1.15 ==
 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions
index 1dc6fd6..88d0b5c 100644 (file)
@@ -117,8 +117,6 @@ class ImagePage extends Article {
                                $wgOut->addWikiText( $fol );
                        }
                        $wgOut->addHTML( '<div id="shared-image-desc">' . $this->mExtraDescription . '</div>' );
-               } else {
-                       $this->checkSharedConflict();
                }
 
                $this->closeShowImage();
@@ -502,54 +500,6 @@ EOT
                }
        }
 
-       /*
-        * Check for files with the same name on the foreign repos.
-        */
-       protected function checkSharedConflict() {
-               global $wgOut, $wgUser;
-               
-               $repoGroup = RepoGroup::singleton();
-               if( !$repoGroup->hasForeignRepos() ) {
-                       return;
-               }
-               
-               $this->loadFile();
-               if( !$this->img->isLocal() ) {
-                       return;
-               }
-
-               $this->dupFile = null;
-               $repoGroup->forEachForeignRepo( array( $this, 'checkSharedConflictCallback' ) );
-               
-               if( !$this->dupFile )
-                       return;
-               $dupfile = $this->dupFile;
-               $same = (
-                       ($this->img->getSha1() == $dupfile->getSha1()) &&
-                       ($this->img->getSize() == $dupfile->getSize())
-               );
-
-               $sk = $wgUser->getSkin();
-               $descUrl = $dupfile->getDescriptionUrl();
-               if( $same ) {
-                       $link = $sk->makeExternalLink( $descUrl, wfMsg( 'shareduploadduplicate-linktext' ) );
-                       $wgOut->addHTML( '<div id="shared-image-dup">' . wfMsgWikiHtml( 'shareduploadduplicate', $link ) . '</div>' );
-               } else {
-                       $link = $sk->makeExternalLink( $descUrl, wfMsg( 'shareduploadconflict-linktext' ) );
-                       $wgOut->addHTML( '<div id="shared-image-conflict">' . wfMsgWikiHtml( 'shareduploadconflict', $link ) . '</div>' );
-               }
-       }
-
-       public function checkSharedConflictCallback( $repo ) {
-               $this->loadFile();
-               $dupfile = $repo->newFile( $this->img->getTitle() );
-               if( $dupfile && $dupfile->exists() ) {
-                       $this->dupFile = $dupfile;
-                       return $dupfile->exists();
-               }
-               return false;
-       }
-
        public function getUploadUrl() {
                $this->loadFile();
                $uploadTitle = SpecialPage::getTitleFor( 'Upload' );
index f5513e6..f6023db 100644 (file)
@@ -1986,10 +1986,6 @@ A [[Special:WhatLinksHere/$2|full list]] is available.',
 'shareduploadwiki-desc'          => 'The description on its $1 on the shared repository is shown below.',
 'shareduploadwiki-linktext'      => 'file description page',
 'shareddescriptionfollows'       => '-', # do not translate or duplicate this message to other languages
-'shareduploadduplicate'          => 'This file is a duplicate of $1 from shared repository.',
-'shareduploadduplicate-linktext' => 'another file',
-'shareduploadconflict'           => 'This file has the same name as $1 from the shared repository.',
-'shareduploadconflict-linktext'  => 'another file',
 'noimage'                        => 'No file by this name exists, but you can $1.',
 'noimage-linktext'               => 'upload one',
 'uploadnewversion-linktext'      => 'Upload a new version of this file',
index 7ed875d..cdd9061 100644 (file)
@@ -1243,10 +1243,6 @@ $wgMessageStructure = array(
                'shareduploadwiki-desc',
                'shareduploadwiki-linktext',
                'shareddescriptionfollows',
-               'shareduploadduplicate',
-               'shareduploadduplicate-linktext',
-               'shareduploadconflict',
-               'shareduploadconflict-linktext',
                'noimage',
                'noimage-linktext',
                'uploadnewversion-linktext',