* @return string
*/
static function getEditToolbar() {
- global $wgStylePath, $wgContLang, $wgLang, $wgJsMimeType;
+ global $wgStylePath, $wgContLang, $wgLang;
/**
* toolarray an array of arrays which each include the filename of
)
);
$toolbar = "<div id='toolbar'>\n";
- $toolbar.="<script type='$wgJsMimeType'>\n/*<![CDATA[*/\n";
- foreach($toolarray as $tool) {
+ $script = '';
+ foreach ( $toolarray as $tool ) {
$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.
$paramList = implode( ',',
array_map( array( 'Xml', 'encodeJsVar' ), $params ) );
- $toolbar.="addButton($paramList);\n";
+ $script .= "addButton($paramList);\n";
}
+ $toolbar .= Html::inlineScript( "\n$script\n" );
- $toolbar.="/*]]>*/\n</script>";
- $toolbar.="\n</div>";
+ $toolbar .= "\n</div>";
wfRunHooks( 'EditPageBeforeEditToolbar', array( &$toolbar ) );