Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -2111,7 +2111,10 @@ |
2112 | 2112 | */ |
2113 | 2113 | static function getEditToolbar() { |
2114 | 2114 | global $wgStylePath, $wgContLang, $wgLang, $wgOut; |
| 2115 | + global $wgUseTeX, $wgEnableUploads, $wgForeignFileRepos; |
2115 | 2116 | |
| 2117 | + $imagesAvailable = $wgEnableUploads || count( $wgForeignFileRepos ); |
| 2118 | + |
2116 | 2119 | /** |
2117 | 2120 | |
2118 | 2121 | * toolarray an array of arrays which each include the filename of |
— | — | @@ -2170,7 +2173,7 @@ |
2171 | 2174 | 'tip' => wfMsg( 'headline_tip' ), |
2172 | 2175 | 'key' => 'H' |
2173 | 2176 | ), |
2174 | | - array( |
| 2177 | + $imagesAvailable ? array( |
2175 | 2178 | 'image' => $wgLang->getImageFile( 'button-image' ), |
2176 | 2179 | 'id' => 'mw-editbutton-image', |
2177 | 2180 | 'open' => '[[' . $wgContLang->getNsText( NS_FILE ) . ':', |
— | — | @@ -2178,8 +2181,8 @@ |
2179 | 2182 | 'sample' => wfMsg( 'image_sample' ), |
2180 | 2183 | 'tip' => wfMsg( 'image_tip' ), |
2181 | 2184 | 'key' => 'D' |
2182 | | - ), |
2183 | | - array( |
| 2185 | + ) : false, |
| 2186 | + $imagesAvailable ? array( |
2184 | 2187 | 'image' => $wgLang->getImageFile( 'button-media' ), |
2185 | 2188 | 'id' => 'mw-editbutton-media', |
2186 | 2189 | 'open' => '[[' . $wgContLang->getNsText( NS_MEDIA ) . ':', |
— | — | @@ -2187,8 +2190,8 @@ |
2188 | 2191 | 'sample' => wfMsg( 'media_sample' ), |
2189 | 2192 | 'tip' => wfMsg( 'media_tip' ), |
2190 | 2193 | 'key' => 'M' |
2191 | | - ), |
2192 | | - array( |
| 2194 | + ) : false, |
| 2195 | + $wgUseTeX ? array( |
2193 | 2196 | 'image' => $wgLang->getImageFile( 'button-math' ), |
2194 | 2197 | 'id' => 'mw-editbutton-math', |
2195 | 2198 | 'open' => "<math>", |
— | — | @@ -2196,7 +2199,7 @@ |
2197 | 2200 | 'sample' => wfMsg( 'math_sample' ), |
2198 | 2201 | 'tip' => wfMsg( 'math_tip' ), |
2199 | 2202 | 'key' => 'C' |
2200 | | - ), |
| 2203 | + ) : false, |
2201 | 2204 | array( |
2202 | 2205 | 'image' => $wgLang->getImageFile( 'button-nowiki' ), |
2203 | 2206 | 'id' => 'mw-editbutton-nowiki', |
— | — | @@ -2229,6 +2232,8 @@ |
2230 | 2233 | |
2231 | 2234 | $script = ''; |
2232 | 2235 | foreach ( $toolarray as $tool ) { |
| 2236 | + if ( !$tool ) continue; |
| 2237 | + |
2233 | 2238 | $params = array( |
2234 | 2239 | $image = $wgStylePath . '/common/images/' . $tool['image'], |
2235 | 2240 | // Note that we use the tip both for the ALT tag and the TITLE tag of the image. |