From f884ded6338490c1599a846bda64d97818cb4517 Mon Sep 17 00:00:00 2001 From: Michael Dale Date: Thu, 17 Sep 2009 15:35:15 +0000 Subject: [PATCH] * adds $wgEnableJS2system check for $wgUseAJAXCategories (since it uses some js2 calls loadGM) --- includes/OutputPage.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 68eacc8aba..1e8da8c280 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -199,7 +199,7 @@ class OutputPage { */ function addScriptClass( $js_class ){ global $wgDebugJavaScript, $wgJSAutoloadLocalClasses, $wgJSAutoloadClasses, - $wgEnableScriptLoader, $wgStyleVersion, $wgScriptPath; + $wgEnableScriptLoader, $wgStyleVersion, $wgScriptPath, $wgEnableJS2system; $path = jsScriptLoader::getJsPathFromClass( $js_class ); if( $path !== false ){ @@ -214,10 +214,12 @@ class OutputPage { $urlAppend = ( $wgDebugJavaScript ) ? time() : $this->getURIDparam( $js_class ); $this->addScript( Html::linkedScript( "$path?$urlAppend" ) ); - //merge in language text: - $inlineMsg = jsScriptLoader::getLocalizedMsgsFromClass( $js_class ); - if( $inlineMsg != '' ) - $this->addScript( Html::inlineScript( $inlineMsg )); + //merge in language text (if js2 is on and we have loadGM function) + if( $wgEnableJS2system == true ){ + $inlineMsg = jsScriptLoader::getLocalizedMsgsFromClass( $js_class ); + if( $inlineMsg != '' ) + $this->addScript( Html::inlineScript( $inlineMsg )); + } } return true; } @@ -1158,8 +1160,8 @@ class OutputPage { $this->addScriptFile( 'rightclickedit.js' ); } - global $wgUseAJAXCategories; - if ($wgUseAJAXCategories) { + global $wgUseAJAXCategories, $wgEnableJS2system; + if ($wgUseAJAXCategories && $wgEnableJS2system) { global $wgAJAXCategoriesNamespaces; $title = $this->getTitle(); -- 2.20.1