Only add WikiEditor for content model WikiText

Together with solving bug 29908, this makes the presence of the
toolbar consistent. It is added to pages handling wikitext.

Note that we provide the CodeEditor on all JS/CSS/Lua pages.

Bug: 24713
Bug: 24041
Change-Id: Iaa6b9a6c511380ed1669d8b95cba4a3ddc6f9ab6
This commit is contained in:
Derk-Jan Hartman 2014-06-22 16:30:30 +02:00 committed by Paladox
parent e50916e67b
commit dbbb722210

View file

@ -155,11 +155,14 @@ class WikiEditorHooks {
*
* Adds the modules to the edit form
*
* @param $toolbar array list of toolbar items
* @param $editPage EditPage the current EditPage object.
* @param $output OutputPage object.
* @return bool
*/
public static function editPageShowEditFormInitial( &$toolbar ) {
global $wgOut;
public static function editPageShowEditFormInitial( $editPage, $outputPage ) {
if ( $editPage->contentModel !== CONTENT_MODEL_WIKITEXT ) {
return true;
}
// Add modules for enabled features
foreach ( self::$features as $name => $feature ) {
@ -167,10 +170,10 @@ class WikiEditorHooks {
continue;
}
if ( isset( $feature['stylemodules'] ) ) {
$wgOut->addModuleStyles( $feature['stylemodules'] );
$outputPage->addModuleStyles( $feature['stylemodules'] );
}
if ( isset( $feature['modules'] ) ) {
$wgOut->addModules( $feature['modules'] );
$outputPage->addModules( $feature['modules'] );
}
}
return true;