$sk = $wgUser->getSkin();
foreach ( $dupes as $file ) {
+ $fromSrc = '';
if( $file->isLocal() )
$link = $sk->makeKnownLinkObj( $file->getTitle(), "" );
else {
$link = $sk->makeExternalLink( $file->getDescriptionUrl(),
$file->getTitle()->getPrefixedText() );
+ $fromSrc = wfMsg( 'shared-repo-from', $file->getRepo()->getDisplayName() );
}
- $wgOut->addHTML( "<li>{$link}</li>\n" );
+ $wgOut->addHTML( "<li>{$link} {$fromSrc}</li>\n" );
}
$wgOut->addHTML( "</ul></div>\n" );
}
function findBySha1( $hash ) {
return array();
}
+
+ /**
+ * Get the human-readable name of the repo.
+ * @return string
+ */
+ public function getDisplayName() {
+ // We don't name our own repo, return nothing
+ if ( $this->name == 'local' ) {
+ return null;
+ }
+ $repoName = wfMsg( 'shared-repo-' . $this->name );
+ if ( !wfEmptyMsg( 'shared-repo-' . $this->name, $repoName ) ) {
+ return $repoName;
+ }
+ return wfMsg( 'shared-repo' );
+ }
}
'noimage' => 'No file by this name exists, but you can $1.',
'noimage-linktext' => 'upload one',
'uploadnewversion-linktext' => 'Upload a new version of this file',
+'shared-repo-from' => 'from $1', // $1 is the repository name
+'shared-repo' => 'shared repository', // used when shared-repo-NAME doesn't exist
# File reversion
'filerevert' => 'Revert $1',
'noimage',
'noimage-linktext',
'uploadnewversion-linktext',
+ 'shared-repo-from',
+ 'shared-repo',
),
'filerevert' => array(
'filerevert',