http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72778

Revision: 72778
Author:   tparscal
Date:     2010-09-11 08:06:38 +0000 (Sat, 11 Sep 2010)

Log Message:
-----------
Moved a config back to Skin::makeGlobalVaiablesScript because it depends on the 
user object.

Modified Paths:
--------------
    trunk/phase3/includes/ResourceLoaderModule.php
    trunk/phase3/includes/Skin.php

Modified: trunk/phase3/includes/ResourceLoaderModule.php
===================================================================
--- trunk/phase3/includes/ResourceLoaderModule.php      2010-09-11 08:03:11 UTC 
(rev 72777)
+++ trunk/phase3/includes/ResourceLoaderModule.php      2010-09-11 08:06:38 UTC 
(rev 72778)
@@ -947,7 +947,6 @@
                if ( $wgUseAjax && $wgEnableMWSuggest ) {
                        $vars['wgMWSuggestTemplate'] = 
SearchEngine::getMWSuggestTemplate();
                        $vars['wgDBname'] = $wgDBname;
-                       $vars['wgSearchNamespaces'] = 
SearchEngine::userNamespaces( $wgUser );
                }
                
                return $vars;

Modified: trunk/phase3/includes/Skin.php
===================================================================
--- trunk/phase3/includes/Skin.php      2010-09-11 08:03:11 UTC (rev 72777)
+++ trunk/phase3/includes/Skin.php      2010-09-11 08:06:38 UTC (rev 72778)
@@ -373,7 +373,7 @@
         * 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 @@
                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 ) );



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to