Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1246,6 +1246,8 @@ |
1247 | 1247 | 'noimage', |
1248 | 1248 | 'noimage-linktext', |
1249 | 1249 | 'uploadnewversion-linktext', |
| 1250 | + 'shared-repo-from', |
| 1251 | + 'shared-repo', |
1250 | 1252 | ), |
1251 | 1253 | 'filerevert' => array( |
1252 | 1254 | 'filerevert', |
Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -646,13 +646,15 @@ |
647 | 647 | |
648 | 648 | $sk = $wgUser->getSkin(); |
649 | 649 | foreach ( $dupes as $file ) { |
| 650 | + $fromSrc = ''; |
650 | 651 | if( $file->isLocal() ) |
651 | 652 | $link = $sk->makeKnownLinkObj( $file->getTitle(), "" ); |
652 | 653 | else { |
653 | 654 | $link = $sk->makeExternalLink( $file->getDescriptionUrl(), |
654 | 655 | $file->getTitle()->getPrefixedText() ); |
| 656 | + $fromSrc = wfMsg( 'shared-repo-from', $file->getRepo()->getDisplayName() ); |
655 | 657 | } |
656 | | - $wgOut->addHTML( "<li>{$link}</li>\n" ); |
| 658 | + $wgOut->addHTML( "<li>{$link} {$fromSrc}</li>\n" ); |
657 | 659 | } |
658 | 660 | $wgOut->addHTML( "</ul></div>\n" ); |
659 | 661 | } |
Index: trunk/phase3/includes/filerepo/FileRepo.php |
— | — | @@ -538,4 +538,20 @@ |
539 | 539 | function findBySha1( $hash ) { |
540 | 540 | return array(); |
541 | 541 | } |
| 542 | + |
| 543 | + /** |
| 544 | + * Get the human-readable name of the repo. |
| 545 | + * @return string |
| 546 | + */ |
| 547 | + public function getDisplayName() { |
| 548 | + // We don't name our own repo, return nothing |
| 549 | + if ( $this->name == 'local' ) { |
| 550 | + return null; |
| 551 | + } |
| 552 | + $repoName = wfMsg( 'shared-repo-' . $this->name ); |
| 553 | + if ( !wfEmptyMsg( 'shared-repo-' . $this->name, $repoName ) ) { |
| 554 | + return $repoName; |
| 555 | + } |
| 556 | + return wfMsg( 'shared-repo' ); |
| 557 | + } |
542 | 558 | } |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1989,6 +1989,8 @@ |
1990 | 1990 | 'noimage' => 'No file by this name exists, but you can $1.', |
1991 | 1991 | 'noimage-linktext' => 'upload one', |
1992 | 1992 | 'uploadnewversion-linktext' => 'Upload a new version of this file', |
| 1993 | +'shared-repo-from' => 'from $1', // $1 is the repository name |
| 1994 | +'shared-repo' => 'shared repository', // used when shared-repo-NAME doesn't exist |
1993 | 1995 | |
1994 | 1996 | # File reversion |
1995 | 1997 | 'filerevert' => 'Revert $1', |