/** @var array */
protected $mModuleStyles = array();
- /** @var array */
- protected $mModuleMessages = array();
-
/** @var ResourceLoader */
protected $mResourceLoader;
/**
* Get the list of module messages to include on this page
*
+ * @deprecated since 1.26 Obsolete
* @param bool $filter
* @param string|null $position
- *
* @return array Array of module names
*/
public function getModuleMessages( $filter = false, $position = null ) {
- return $this->getModules( $filter, $position, 'mModuleMessages' );
+ wfDeprecated( __METHOD__, '1.26' );
+ return array();
}
/**
- * Add only messages of one or more modules recognized by the resource loader.
- * Module messages added through this function will be loaded by the resource
- * loader when the page loads.
+ * Load messages of one or more ResourceLoader modules.
*
+ * @deprecated since 1.26 Use addModules() instead
* @param string|array $modules Module name (string) or array of module names
*/
public function addModuleMessages( $modules ) {
- $this->mModuleMessages = array_merge( $this->mModuleMessages, (array)$modules );
+ wfDeprecated( __METHOD__, '1.26' );
}
/**
$this->addModules( $parserOutput->getModules() );
$this->addModuleScripts( $parserOutput->getModuleScripts() );
$this->addModuleStyles( $parserOutput->getModuleStyles() );
- $this->addModuleMessages( $parserOutput->getModuleMessages() );
$this->addJsConfigVars( $parserOutput->getJsConfigVars() );
$this->mPreventClickjacking = $this->mPreventClickjacking
|| $parserOutput->preventClickjacking();
$this->addModules( $parserOutput->getModules() );
$this->addModuleScripts( $parserOutput->getModuleScripts() );
$this->addModuleStyles( $parserOutput->getModuleStyles() );
- $this->addModuleMessages( $parserOutput->getModuleMessages() );
$this->addJsConfigVars( $parserOutput->getJsConfigVars() );
}
// and we shouldn't be putting timestamps in Squid-cached HTML
$version = null;
if ( $group === 'user' ) {
- // Get the maximum timestamp
- $timestamp = 1;
- foreach ( $grpModules as $module ) {
- $timestamp = max( $timestamp, $module->getModifiedTime( $context ) );
- }
- // Add a version parameter so cache will break when things change
- $query['version'] = wfTimestamp( TS_ISO_8601_BASIC, $timestamp );
+ $query['version'] = $resourceLoader->getCombinedVersion( $context, array_keys( $grpModules ) );
}
$query['modules'] = ResourceLoader::makePackedModulesString( array_keys( $grpModules ) );
$links[] = $this->makeResourceLoaderLink( $embedScripts, ResourceLoaderModule::TYPE_COMBINED );
// Scripts and messages "only" requests marked for top inclusion
- // Messages should go first
- $links[] = $this->makeResourceLoaderLink(
- $this->getModuleMessages( true, 'top' ),
- ResourceLoaderModule::TYPE_MESSAGES
- );
$links[] = $this->makeResourceLoaderLink(
$this->getModuleScripts( true, 'top' ),
ResourceLoaderModule::TYPE_SCRIPTS
* @return string
*/
function getScriptsForBottomQueue( $inHead ) {
- // Scripts and messages "only" requests marked for bottom inclusion
+ // Scripts "only" requests marked for bottom inclusion
// If we're in the <head>, use load() calls rather than <script src="..."> tags
- // Messages should go first
$links = array();
- $links[] = $this->makeResourceLoaderLink( $this->getModuleMessages( true, 'bottom' ),
- ResourceLoaderModule::TYPE_MESSAGES, /* $useESI = */ false, /* $extraQuery = */ array(),
- /* $loadCall = */ $inHead
- );
$links[] = $this->makeResourceLoaderLink( $this->getModuleScripts( true, 'bottom' ),
ResourceLoaderModule::TYPE_SCRIPTS, /* $useESI = */ false, /* $extraQuery = */ array(),
/* $loadCall = */ $inHead