'api', 'default' => '1', ]; return true; } /** * @param EditPage $editpage * @param OutputPage $output * @return bool */ public static function editPageShowEditFormInitial( EditPage $editpage, OutputPage $output ) { $title = $editpage->getContextTitle(); $model = $editpage->contentModel; $format = $editpage->contentFormat; $lang = self::getPageLanguage( $title, $model, $format ); if ( $lang && $output->getUser()->getOption( 'usebetatoolbar' ) ) { $output->addModules( 'ext.codeEditor' ); $output->addJsConfigVars( 'wgCodeEditorCurrentLanguage', $lang ); } elseif ( !ExtensionRegistry::getInstance()->isLoaded( "WikiEditor" ) ) { throw new ErrorPageError( "codeeditor-error-title", "codeeditor-error-message" ); } return true; } }