*/
static function getEditToolbar() {
global $wgStylePath, $wgContLang, $wgLang, $wgOut;
+ global $wgUseTeX, $wgEnableUploads, $wgForeignFileRepos;
+
+ $imagesAvailable = $wgEnableUploads || count( $wgForeignFileRepos );
/**
'tip' => wfMsg( 'headline_tip' ),
'key' => 'H'
),
- array(
+ $imagesAvailable ? array(
'image' => $wgLang->getImageFile( 'button-image' ),
'id' => 'mw-editbutton-image',
'open' => '[[' . $wgContLang->getNsText( NS_FILE ) . ':',
'sample' => wfMsg( 'image_sample' ),
'tip' => wfMsg( 'image_tip' ),
'key' => 'D'
- ),
- array(
+ ) : false,
+ $imagesAvailable ? array(
'image' => $wgLang->getImageFile( 'button-media' ),
'id' => 'mw-editbutton-media',
'open' => '[[' . $wgContLang->getNsText( NS_MEDIA ) . ':',
'sample' => wfMsg( 'media_sample' ),
'tip' => wfMsg( 'media_tip' ),
'key' => 'M'
- ),
- array(
+ ) : false,
+ $wgUseTeX ? array(
'image' => $wgLang->getImageFile( 'button-math' ),
'id' => 'mw-editbutton-math',
'open' => "<math>",
'sample' => wfMsg( 'math_sample' ),
'tip' => wfMsg( 'math_tip' ),
'key' => 'C'
- ),
+ ) : false,
array(
'image' => $wgLang->getImageFile( 'button-nowiki' ),
'id' => 'mw-editbutton-nowiki',
$script = '';
foreach ( $toolarray as $tool ) {
+ if ( !$tool ) continue;
+
$params = array(
$image = $wgStylePath . '/common/images/' . $tool['image'],
// Note that we use the tip both for the ALT tag and the TITLE tag of the image.