mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor
synced 2024-11-27 16:40:07 +00:00
Merge "Revert "Directly use $wgTitle instead of relying on getContextTitle fallback""
This commit is contained in:
commit
d75911245e
|
@ -1,8 +1,6 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<ruleset>
|
<ruleset>
|
||||||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
|
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" />
|
||||||
<exclude name="MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle" />
|
|
||||||
</rule>
|
|
||||||
<file>.</file>
|
<file>.</file>
|
||||||
<arg name="extensions" value="php,php5,inc" />
|
<arg name="extensions" value="php,php5,inc" />
|
||||||
<arg name="encoding" value="UTF-8" />
|
<arg name="encoding" value="UTF-8" />
|
||||||
|
|
|
@ -41,12 +41,11 @@ class CodeEditorHooks {
|
||||||
* @throws ErrorPageError
|
* @throws ErrorPageError
|
||||||
*/
|
*/
|
||||||
public static function editPageShowEditFormInitial( EditPage $editpage, OutputPage $output ) {
|
public static function editPageShowEditFormInitial( EditPage $editpage, OutputPage $output ) {
|
||||||
global $wgTitle;
|
$title = $editpage->getContextTitle();
|
||||||
|
|
||||||
$model = $editpage->contentModel;
|
$model = $editpage->contentModel;
|
||||||
$format = $editpage->contentFormat;
|
$format = $editpage->contentFormat;
|
||||||
|
|
||||||
$lang = self::getPageLanguage( $wgTitle, $model, $format );
|
$lang = self::getPageLanguage( $title, $model, $format );
|
||||||
if ( $lang && $output->getUser()->getOption( 'usebetatoolbar' ) ) {
|
if ( $lang && $output->getUser()->getOption( 'usebetatoolbar' ) ) {
|
||||||
$output->addModules( 'ext.codeEditor' );
|
$output->addModules( 'ext.codeEditor' );
|
||||||
$output->addJsConfigVars( 'wgCodeEditorCurrentLanguage', $lang );
|
$output->addJsConfigVars( 'wgCodeEditorCurrentLanguage', $lang );
|
||||||
|
|
Loading…
Reference in a new issue