From c7901d2b5b97675666d733cf518db0a0759ca85e Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 5 Feb 2010 14:07:18 +0000 Subject: [PATCH] * (bug 22364) Setting $wgUseExternalEditor to false no longer hides the reupload link from file pages --- RELEASE-NOTES | 2 ++ includes/ImagePage.php | 32 +++++++++++++++++--------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 292dbe4e06..30ff67cda4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -739,6 +739,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 21518) Special:UserRights no longer displays the user name box for users that can only change their rights * (bug 21593) Special:UserRights now lists automatic groups membership +* (bug 22364) Setting $wgUseExternalEditor to false no longer hides the reupload + link from file pages == API changes in 1.16 == diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 40cbe7c114..dd2c2ab1fc 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -551,7 +551,7 @@ EOT * external editing (and instructions link) etc. */ protected function uploadLinksBox() { - global $wgUser, $wgOut, $wgEnableUploads; + global $wgUser, $wgOut, $wgEnableUploads, $wgUseExternalEditor; if( !$wgEnableUploads ) { return; } @@ -570,18 +570,20 @@ EOT } # External editing link - $elink = $sk->link( - $this->mTitle, - wfMsgHtml( 'edit-externally' ), - array(), - array( - 'action' => 'edit', - 'externaledit' => 'true', - 'mode' => 'file' - ), - array( 'known', 'noclasses' ) - ); - $wgOut->addHTML( '
  • ' . $elink . ' ' . wfMsgExt( 'edit-externally-help', array( 'parseinline' ) ) . "
  • \n" ); + if ( $wgUseExternalEditor ) { + $elink = $sk->link( + $this->mTitle, + wfMsgHtml( 'edit-externally' ), + array(), + array( + 'action' => 'edit', + 'externaledit' => 'true', + 'mode' => 'file' + ), + array( 'known', 'noclasses' ) + ); + $wgOut->addHTML( '
  • ' . $elink . ' ' . wfMsgExt( 'edit-externally-help', array( 'parseinline' ) ) . "
  • \n" ); + } $wgOut->addHTML( "\n" ); } @@ -593,7 +595,7 @@ EOT * we follow it with an upload history of the image and its usage. */ protected function imageHistory() { - global $wgOut, $wgUseExternalEditor; + global $wgOut; $this->loadFile(); $pager = new ImageHistoryPseudoPager( $this ); @@ -603,7 +605,7 @@ EOT # Exist check because we don't want to show this on pages where an image # doesn't exist along with the noimage message, that would suck. -ævar - if( $wgUseExternalEditor && $this->img->exists() ) { + if( $this->img->exists() ) { $this->uploadLinksBox(); } } -- 2.20.1