Index: trunk/phase3/includes/Skin.php |
— | — | @@ -373,7 +373,7 @@ |
374 | 374 | * You will only be adding bloat to the page and causing page caches to have to be purged on configuration changes. |
375 | 375 | */ |
376 | 376 | static function makeGlobalVariablesScript( $skinName ) { |
377 | | - global $wgTitle, $wgUser, $wgRequest, $wgArticle, $wgOut, $wgRestrictionTypes; |
| 377 | + global $wgTitle, $wgUser, $wgRequest, $wgArticle, $wgOut, $wgRestrictionTypes, $wgUseAjax, $wgEnableMWSuggest; |
378 | 378 | |
379 | 379 | $ns = $wgTitle->getNamespace(); |
380 | 380 | $nsname = MWNamespace::exists( $ns ) ? MWNamespace::getCanonicalName( $ns ) : $wgTitle->getNsText(); |
— | — | @@ -395,6 +395,9 @@ |
396 | 396 | foreach ( $wgRestrictionTypes as $type ) { |
397 | 397 | $vars['wgRestriction' . ucfirst( $type )] = $wgTitle->getRestrictions( $type ); |
398 | 398 | } |
| 399 | + if ( $wgUseAjax && $wgEnableMWSuggest && !$wgUser->getOption( 'disablesuggest', false ) ) { |
| 400 | + $vars['wgSearchNamespaces'] = SearchEngine::userNamespaces( $wgUser ); |
| 401 | + } |
399 | 402 | |
400 | 403 | // Allow extensions to add their custom variables to the global JS variables |
401 | 404 | wfRunHooks( 'MakeGlobalVariablesScript', array( &$vars ) ); |
Index: trunk/phase3/includes/ResourceLoaderModule.php |
— | — | @@ -947,7 +947,6 @@ |
948 | 948 | if ( $wgUseAjax && $wgEnableMWSuggest ) { |
949 | 949 | $vars['wgMWSuggestTemplate'] = SearchEngine::getMWSuggestTemplate(); |
950 | 950 | $vars['wgDBname'] = $wgDBname; |
951 | | - $vars['wgSearchNamespaces'] = SearchEngine::userNamespaces( $wgUser ); |
952 | 951 | } |
953 | 952 | |
954 | 953 | return $vars; |