fix for bug34431 - Disable the old toolbar if the new toolbar is enabled

This commit is contained in:
Benny Situ 2012-02-17 22:13:11 +00:00
parent 23cc687a9b
commit 0609dffdf3
Notes: Benny Situ 2012-02-17 22:13:11 +00:00
2 changed files with 17 additions and 0 deletions

View file

@ -213,6 +213,22 @@ class WikiEditorHooks {
return true;
}
/**
* EditPageBeforeEditToolbar hook
*
* Disable the old toolbar if the new one is enabled
*
* @param $toolbar html
* @return bool
*/
public static function EditPageBeforeEditToolbar( &$toolbar ) {
if ( self::isEnabled( 'toolbar' ) ) {
$toolbar = '';
return false;
}
return true;
}
/**
* GetPreferences hook
*

View file

@ -62,6 +62,7 @@ $wgHooks['EditPage::showEditForm:initial'][] = 'WikiEditorHooks::editPageShowEdi
$wgHooks['GetPreferences'][] = 'WikiEditorHooks::getPreferences';
$wgHooks['ResourceLoaderGetConfigVars'][] = 'WikiEditorHooks::resourceLoaderGetConfigVars';
$wgHooks['MakeGlobalVariablesScript'][] = 'WikiEditorHooks::makeGlobalVariablesScript';
$wgHooks['EditPageBeforeEditToolbar'][] = 'WikiEditorHooks::EditPageBeforeEditToolbar';
$wikiEditorTpl = array(
'localBasePath' => dirname( __FILE__ ) . '/modules',