From: Trevor Parscal Date: Sat, 11 Sep 2010 08:06:38 +0000 (+0000) Subject: Moved a config back to Skin::makeGlobalVaiablesScript because it depends on the user... X-Git-Tag: 1.31.0-rc.0~35020 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=27fc0412264a6d45ab2dce4ac478a6f282c76155;p=lhc%2Fweb%2Fwiklou.git Moved a config back to Skin::makeGlobalVaiablesScript because it depends on the user object. --- diff --git a/includes/ResourceLoaderModule.php b/includes/ResourceLoaderModule.php index 8184dbbfda..afd4fada7f 100644 --- a/includes/ResourceLoaderModule.php +++ b/includes/ResourceLoaderModule.php @@ -947,7 +947,6 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { if ( $wgUseAjax && $wgEnableMWSuggest ) { $vars['wgMWSuggestTemplate'] = SearchEngine::getMWSuggestTemplate(); $vars['wgDBname'] = $wgDBname; - $vars['wgSearchNamespaces'] = SearchEngine::userNamespaces( $wgUser ); } return $vars; diff --git a/includes/Skin.php b/includes/Skin.php index d9b58468b6..527e6599ba 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -373,7 +373,7 @@ class Skin extends Linker { * You will only be adding bloat to the page and causing page caches to have to be purged on configuration changes. */ static function makeGlobalVariablesScript( $skinName ) { - global $wgTitle, $wgUser, $wgRequest, $wgArticle, $wgOut, $wgRestrictionTypes; + global $wgTitle, $wgUser, $wgRequest, $wgArticle, $wgOut, $wgRestrictionTypes, $wgUseAjax, $wgEnableMWSuggest; $ns = $wgTitle->getNamespace(); $nsname = MWNamespace::exists( $ns ) ? MWNamespace::getCanonicalName( $ns ) : $wgTitle->getNsText(); @@ -395,6 +395,9 @@ class Skin extends Linker { foreach ( $wgRestrictionTypes as $type ) { $vars['wgRestriction' . ucfirst( $type )] = $wgTitle->getRestrictions( $type ); } + if ( $wgUseAjax && $wgEnableMWSuggest && !$wgUser->getOption( 'disablesuggest', false ) ) { + $vars['wgSearchNamespaces'] = SearchEngine::userNamespaces( $wgUser ); + } // Allow extensions to add their custom variables to the global JS variables wfRunHooks( 'MakeGlobalVariablesScript', array( &$vars ) );