Added alias of jQuery to $j - this is only to get site/user scripts that were using...
[lhc/web/wiklou.git] / includes / Skin.php
index d9b5846..dbce2af 100644 (file)
@@ -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 ) );
@@ -478,7 +481,7 @@ class Skin extends Linker {
         * @private
         */
        function setupUserCss( OutputPage $out ) {
-               global $wgRequest, $wgUser;
+               global $wgRequest;
                global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs, $wgSquidMaxage;
 
                wfProfileIn( __METHOD__ );