r72778 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72777‎ | r72778 | r72779 >
Date:08:06, 11 September 2010
Author:tparscal
Status:ok
Tags:
Comment:
Moved a config back to Skin::makeGlobalVaiablesScript because it depends on the user object.
Modified paths:
  • /trunk/phase3/includes/ResourceLoaderModule.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Skin.php
@@ -373,7 +373,7 @@
374374 * You will only be adding bloat to the page and causing page caches to have to be purged on configuration changes.
375375 */
376376 static function makeGlobalVariablesScript( $skinName ) {
377 - global $wgTitle, $wgUser, $wgRequest, $wgArticle, $wgOut, $wgRestrictionTypes;
 377+ global $wgTitle, $wgUser, $wgRequest, $wgArticle, $wgOut, $wgRestrictionTypes, $wgUseAjax, $wgEnableMWSuggest;
378378
379379 $ns = $wgTitle->getNamespace();
380380 $nsname = MWNamespace::exists( $ns ) ? MWNamespace::getCanonicalName( $ns ) : $wgTitle->getNsText();
@@ -395,6 +395,9 @@
396396 foreach ( $wgRestrictionTypes as $type ) {
397397 $vars['wgRestriction' . ucfirst( $type )] = $wgTitle->getRestrictions( $type );
398398 }
 399+ if ( $wgUseAjax && $wgEnableMWSuggest && !$wgUser->getOption( 'disablesuggest', false ) ) {
 400+ $vars['wgSearchNamespaces'] = SearchEngine::userNamespaces( $wgUser );
 401+ }
399402
400403 // Allow extensions to add their custom variables to the global JS variables
401404 wfRunHooks( 'MakeGlobalVariablesScript', array( &$vars ) );
Index: trunk/phase3/includes/ResourceLoaderModule.php
@@ -947,7 +947,6 @@
948948 if ( $wgUseAjax && $wgEnableMWSuggest ) {
949949 $vars['wgMWSuggestTemplate'] = SearchEngine::getMWSuggestTemplate();
950950 $vars['wgDBname'] = $wgDBname;
951 - $vars['wgSearchNamespaces'] = SearchEngine::userNamespaces( $wgUser );
952951 }
953952
954953 return $vars;

Status & tagging log