Index: trunk/phase3/includes/ExternalEdit.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | /** |
31 | 31 | * Constructor |
32 | 32 | * @param $context IContextSource context to use |
33 | | - * @param $mode String What mode we're using. Only 'file' has any effect |
| 33 | + * @param $urls array |
34 | 34 | */ |
35 | 35 | public function __construct( IContextSource $context, array $urls = array() ) { |
36 | 36 | $this->setContext( $context ); |
— | — | @@ -77,24 +77,22 @@ |
78 | 78 | if ( count( $this->urls ) ) { |
79 | 79 | $urls = $this->urls; |
80 | 80 | $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 | + ) ); |
81 | 88 | } 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 | + ) ); |
99 | 97 | } |
100 | 98 | |
101 | 99 | $files = ''; |