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
$wgOut->addWikiText( $fol );
}
$wgOut->addHTML( '<div id="shared-image-desc">' . $this->mExtraDescription . '</div>' );
- } else {
- $this->checkSharedConflict();
}
$this->closeShowImage();
}
}
- /*
- * 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' );
'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',
'shareduploadwiki-desc',
'shareduploadwiki-linktext',
'shareddescriptionfollows',
- 'shareduploadduplicate',
- 'shareduploadduplicate-linktext',
- 'shareduploadconflict',
- 'shareduploadconflict-linktext',
'noimage',
'noimage-linktext',
'uploadnewversion-linktext',