mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor
synced 2024-11-14 19:14:41 +00:00
$wgTitle and $wgOut weren't needed here
EditPage::showForm::initial was wrong about its parameters. Change-Id: I7f2194dee00090a0c4ff35684607384cfc6897a9
This commit is contained in:
parent
f399b074ab
commit
d9b9580e6f
|
@ -25,19 +25,16 @@ class CodeEditorHooks {
|
|||
return $lang;
|
||||
}
|
||||
|
||||
public static function editPageShowEditFormInitial( &$toolbar ) {
|
||||
global $wgOut, $wgTitle;
|
||||
$lang = self::getPageLanguage( $wgTitle );
|
||||
public static function editPageShowEditFormInitial( $editpage, $output ) {
|
||||
$lang = self::getPageLanguage( $editpage->getContextTitle() );
|
||||
if ( $lang ) {
|
||||
$wgOut->addModules( 'ext.codeEditor' );
|
||||
$output->addModules( 'ext.codeEditor' );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function onMakeGlobalVariablesScript( &$vars, $output ) {
|
||||
global $wgTitle;
|
||||
|
||||
$lang = self::getPageLanguage( $wgTitle );
|
||||
$lang = self::getPageLanguage( $output->getTitle() );
|
||||
if( $lang ) {
|
||||
$vars['wgCodeEditorCurrentLanguage'] = $lang;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue