Merge "resourceloader: ResourceLoaderGetConfigVars is passed skin"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 29 Oct 2018 01:56:40 +0000 (01:56 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 29 Oct 2018 01:56:40 +0000 (01:56 +0000)
docs/hooks.txt
includes/resourceloader/ResourceLoaderStartUpModule.php

index ffefe97..f9ae150 100644 (file)
@@ -2876,7 +2876,9 @@ $context: ResourceLoaderContext|null
 ResourceLoaderStartUpModule::getConfigSettings(). Use this to export static
 configuration variables to JavaScript. Things that depend on the current page
 or request state must be added through MakeGlobalVariablesScript instead.
+Skin is made available for skin specific config.
 &$vars: [ variable name => value ]
+$skin: Skin
 
 'ResourceLoaderJqueryMsgModuleMagicWords': Called in
 ResourceLoaderJqueryMsgModule to allow adding magic words for jQueryMsg.
index e4a753f..b5d31ef 100644 (file)
@@ -78,10 +78,11 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                $oldCommentSchema = $conf->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD;
 
                // Build list of variables
+               $skin = $context->getSkin();
                $vars = [
                        'wgLoadScript' => wfScript( 'load' ),
                        'debug' => $context->getDebug(),
-                       'skin' => $context->getSkin(),
+                       'skin' => $skin,
                        'stylepath' => $conf->get( 'StylePath' ),
                        'wgUrlProtocols' => wfUrlProtocols(),
                        'wgArticlePath' => $conf->get( 'ArticlePath' ),
@@ -126,7 +127,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                        'wgCommentCodePointLimit' => $oldCommentSchema ? null : CommentStore::COMMENT_CHARACTER_LIMIT,
                ];
 
-               Hooks::run( 'ResourceLoaderGetConfigVars', [ &$vars ] );
+               Hooks::run( 'ResourceLoaderGetConfigVars', [ &$vars, $skin ] );
 
                return $vars;
        }