r108742 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108741‎ | r108742 | r108743 >
Date:19:04, 12 January 2012
Author:reedy
Status:ok
Tags:
Comment:
Unindent code to use elseif
Modified paths:
  • /trunk/phase3/includes/ExternalEdit.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ExternalEdit.php
@@ -29,7 +29,7 @@
3030 /**
3131 * Constructor
3232 * @param $context IContextSource context to use
33 - * @param $mode String What mode we're using. Only 'file' has any effect
 33+ * @param $urls array
3434 */
3535 public function __construct( IContextSource $context, array $urls = array() ) {
3636 $this->setContext( $context );
@@ -77,24 +77,22 @@
7878 if ( count( $this->urls ) ) {
7979 $urls = $this->urls;
8080 $type = "Diff text";
 81+ } elseif ( $this->getRequest()->getVal( 'mode' ) == 'file' ) {
 82+ $type = "Edit file";
 83+ $image = wfLocalFile( $this->getTitle() );
 84+ $urls = array( 'File' => array(
 85+ 'Extension' => $image->getExtension(),
 86+ 'URL' => $image->getCanonicalURL()
 87+ ) );
8188 } else {
82 - if ( $this->getRequest()->getVal( 'mode' ) == 'file' ) {
83 - $type = "Edit file";
84 - $image = wfLocalFile( $this->getTitle() );
85 - $urls = array( 'File' => array(
86 - 'Extension' => $image->getExtension(),
87 - 'URL' => $image->getCanonicalURL()
88 - ) );
89 - } else {
90 - $type = "Edit text";
91 - # *.wiki file extension is used by some editors for syntax
92 - # highlighting, so we follow that convention
93 - $urls = array( 'File' => array(
94 - 'Extension' => 'wiki',
95 - 'URL' => $this->getTitle()->getCanonicalURL(
96 - array( 'action' => 'edit', 'internaledit' => 'true' ) )
97 - ) );
98 - }
 89+ $type = "Edit text";
 90+ # *.wiki file extension is used by some editors for syntax
 91+ # highlighting, so we follow that convention
 92+ $urls = array( 'File' => array(
 93+ 'Extension' => 'wiki',
 94+ 'URL' => $this->getTitle()->getCanonicalURL(
 95+ array( 'action' => 'edit', 'internaledit' => 'true' ) )
 96+ ) );
9997 }
10098
10199 $files = '';

Status & tagging log