r47381 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47380‎ | r47381 | r47382 >
Date:21:33, 17 February 2009
Author:demon
Status:deferred
Tags:
Comment:
* Only show dupe messages for remote images once. Twice is redundant :)
* Phased out sharedupload(duplicate|conflict)(\-linktext)? messages (removed from en and messages.inc)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/ImagePage.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -1243,10 +1243,6 @@
12441244 'shareduploadwiki-desc',
12451245 'shareduploadwiki-linktext',
12461246 'shareddescriptionfollows',
1247 - 'shareduploadduplicate',
1248 - 'shareduploadduplicate-linktext',
1249 - 'shareduploadconflict',
1250 - 'shareduploadconflict-linktext',
12511247 'noimage',
12521248 'noimage-linktext',
12531249 'uploadnewversion-linktext',
Index: trunk/phase3/includes/ImagePage.php
@@ -117,8 +117,6 @@
118118 $wgOut->addWikiText( $fol );
119119 }
120120 $wgOut->addHTML( '<div id="shared-image-desc">' . $this->mExtraDescription . '</div>' );
121 - } else {
122 - $this->checkSharedConflict();
123121 }
124122
125123 $this->closeShowImage();
@@ -502,54 +500,6 @@
503501 }
504502 }
505503
506 - /*
507 - * Check for files with the same name on the foreign repos.
508 - */
509 - protected function checkSharedConflict() {
510 - global $wgOut, $wgUser;
511 -
512 - $repoGroup = RepoGroup::singleton();
513 - if( !$repoGroup->hasForeignRepos() ) {
514 - return;
515 - }
516 -
517 - $this->loadFile();
518 - if( !$this->img->isLocal() ) {
519 - return;
520 - }
521 -
522 - $this->dupFile = null;
523 - $repoGroup->forEachForeignRepo( array( $this, 'checkSharedConflictCallback' ) );
524 -
525 - if( !$this->dupFile )
526 - return;
527 - $dupfile = $this->dupFile;
528 - $same = (
529 - ($this->img->getSha1() == $dupfile->getSha1()) &&
530 - ($this->img->getSize() == $dupfile->getSize())
531 - );
532 -
533 - $sk = $wgUser->getSkin();
534 - $descUrl = $dupfile->getDescriptionUrl();
535 - if( $same ) {
536 - $link = $sk->makeExternalLink( $descUrl, wfMsg( 'shareduploadduplicate-linktext' ) );
537 - $wgOut->addHTML( '<div id="shared-image-dup">' . wfMsgWikiHtml( 'shareduploadduplicate', $link ) . '</div>' );
538 - } else {
539 - $link = $sk->makeExternalLink( $descUrl, wfMsg( 'shareduploadconflict-linktext' ) );
540 - $wgOut->addHTML( '<div id="shared-image-conflict">' . wfMsgWikiHtml( 'shareduploadconflict', $link ) . '</div>' );
541 - }
542 - }
543 -
544 - public function checkSharedConflictCallback( $repo ) {
545 - $this->loadFile();
546 - $dupfile = $repo->newFile( $this->img->getTitle() );
547 - if( $dupfile && $dupfile->exists() ) {
548 - $this->dupFile = $dupfile;
549 - return $dupfile->exists();
550 - }
551 - return false;
552 - }
553 -
554504 public function getUploadUrl() {
555505 $this->loadFile();
556506 $uploadTitle = SpecialPage::getTitleFor( 'Upload' );
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1986,10 +1986,6 @@
19871987 'shareduploadwiki-desc' => 'The description on its $1 on the shared repository is shown below.',
19881988 'shareduploadwiki-linktext' => 'file description page',
19891989 'shareddescriptionfollows' => '-', # do not translate or duplicate this message to other languages
1990 -'shareduploadduplicate' => 'This file is a duplicate of $1 from shared repository.',
1991 -'shareduploadduplicate-linktext' => 'another file',
1992 -'shareduploadconflict' => 'This file has the same name as $1 from the shared repository.',
1993 -'shareduploadconflict-linktext' => 'another file',
19941990 'noimage' => 'No file by this name exists, but you can $1.',
19951991 'noimage-linktext' => 'upload one',
19961992 'uploadnewversion-linktext' => 'Upload a new version of this file',
Index: trunk/phase3/RELEASE-NOTES
@@ -184,6 +184,7 @@
185185 in next page link
186186 * (bug 17506) Exceptions within exceptions now respect $wgShowExceptionDetails
187187 * Fixed excessive job queue utilisation
 188+* File dupe messages for remote repos are now shown only once.
188189
189190 == API changes in 1.15 ==
190191 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions

Status & tagging log