diff --git a/includes/PopupsHooks.php b/includes/PopupsHooks.php index 6b2772c18..39a142e54 100644 --- a/includes/PopupsHooks.php +++ b/includes/PopupsHooks.php @@ -104,11 +104,20 @@ class PopupsHooks { } /** + * Hook handler for the ResourceLoaderStartUpModule that makes static configuration visible to + * the frontend. These variables end in the only "startup" ResourceLoader module that is loaded + * before all others. + * + * Dynamic configuration that depends on the context needs to be published via the + * MakeGlobalVariablesScript hook. + * * @param array &$vars Array of variables to be added into the output of the startup module + * @param string $skin */ - public static function onResourceLoaderGetConfigVars( array &$vars ) { + public static function onResourceLoaderGetConfigVars( array &$vars, $skin ) { /** @var \Config $config */ $config = MediaWikiServices::getInstance()->getService( 'Popups.Config' ); + $vars['wgPopupsVirtualPageViews'] = $config->get( 'PopupsVirtualPageViews' ); $vars['wgPopupsGateway'] = $config->get( 'PopupsGateway' ); $vars['wgPopupsEventLogging'] = $config->get( 'PopupsEventLogging' ); @@ -117,7 +126,8 @@ class PopupsHooks { } /** - * MakeGlobalVariablesScript hook handler. + * Hook handler publishing dynamic configuration that depends on the context, e.g. the page or + * the users settings. These variables end in an inline