From: Sam Reed Date: Thu, 12 Jan 2012 19:04:06 +0000 (+0000) Subject: Unindent code to use elseif X-Git-Tag: 1.31.0-rc.0~25331 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=42ab77ee6f0c481249fa9db0875d8f2be5017519;p=lhc%2Fweb%2Fwiklou.git Unindent code to use elseif --- diff --git a/includes/ExternalEdit.php b/includes/ExternalEdit.php index 9bdbd6cbf3..b8704758bc 100644 --- a/includes/ExternalEdit.php +++ b/includes/ExternalEdit.php @@ -29,7 +29,7 @@ class ExternalEdit extends ContextSource { /** * Constructor * @param $context IContextSource context to use - * @param $mode String What mode we're using. Only 'file' has any effect + * @param $urls array */ public function __construct( IContextSource $context, array $urls = array() ) { $this->setContext( $context ); @@ -77,24 +77,22 @@ class ExternalEdit extends ContextSource { if ( count( $this->urls ) ) { $urls = $this->urls; $type = "Diff text"; + } elseif ( $this->getRequest()->getVal( 'mode' ) == 'file' ) { + $type = "Edit file"; + $image = wfLocalFile( $this->getTitle() ); + $urls = array( 'File' => array( + 'Extension' => $image->getExtension(), + 'URL' => $image->getCanonicalURL() + ) ); } else { - if ( $this->getRequest()->getVal( 'mode' ) == 'file' ) { - $type = "Edit file"; - $image = wfLocalFile( $this->getTitle() ); - $urls = array( 'File' => array( - 'Extension' => $image->getExtension(), - 'URL' => $image->getCanonicalURL() - ) ); - } else { - $type = "Edit text"; - # *.wiki file extension is used by some editors for syntax - # highlighting, so we follow that convention - $urls = array( 'File' => array( - 'Extension' => 'wiki', - 'URL' => $this->getTitle()->getCanonicalURL( - array( 'action' => 'edit', 'internaledit' => 'true' ) ) - ) ); - } + $type = "Edit text"; + # *.wiki file extension is used by some editors for syntax + # highlighting, so we follow that convention + $urls = array( 'File' => array( + 'Extension' => 'wiki', + 'URL' => $this->getTitle()->getCanonicalURL( + array( 'action' => 'edit', 'internaledit' => 'true' ) ) + ) ); } $files = '';