Index: trunk/extensions/WikiEditor/WikiEditor.php |
— | — | @@ -62,6 +62,7 @@ |
63 | 63 | $wgHooks['GetPreferences'][] = 'WikiEditorHooks::getPreferences'; |
64 | 64 | $wgHooks['ResourceLoaderGetConfigVars'][] = 'WikiEditorHooks::resourceLoaderGetConfigVars'; |
65 | 65 | $wgHooks['MakeGlobalVariablesScript'][] = 'WikiEditorHooks::makeGlobalVariablesScript'; |
| 66 | +$wgHooks['EditPageBeforeEditToolbar'][] = 'WikiEditorHooks::EditPageBeforeEditToolbar'; |
66 | 67 | |
67 | 68 | $wikiEditorTpl = array( |
68 | 69 | 'localBasePath' => dirname( __FILE__ ) . '/modules', |
Index: trunk/extensions/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -214,6 +214,22 @@ |
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
| 218 | + * EditPageBeforeEditToolbar hook |
| 219 | + * |
| 220 | + * Disable the old toolbar if the new one is enabled |
| 221 | + * |
| 222 | + * @param $toolbar html |
| 223 | + * @return bool |
| 224 | + */ |
| 225 | + public static function EditPageBeforeEditToolbar( &$toolbar ) { |
| 226 | + if ( self::isEnabled( 'toolbar' ) ) { |
| 227 | + $toolbar = ''; |
| 228 | + return false; |
| 229 | + } |
| 230 | + return true; |
| 231 | + } |
| 232 | + |
| 233 | + /** |
218 | 234 | * GetPreferences hook |
219 | 235 | * |
220 | 236 | * Adds WikiEditor-releated items to the preferences |