}
}
},
+ "ResourceModuleSkinStyles": {
+ "type": "object",
+ "description": "ResourceLoader modules for custom skin styles"
+ },
"ResourceLoaderSources": {
"type": "object",
"description": "ResourceLoader sources to register"
$defaultPaths['localBasePath'] = "$dir/{$defaultPaths['localBasePath']}";
}
- if ( isset( $info['ResourceModules'] ) ) {
- foreach ( $info['ResourceModules'] as $name => $data ) {
- if ( isset( $data['localBasePath'] ) ) {
- $data['localBasePath'] = "$dir/{$data['localBasePath']}";
+ foreach ( array( 'ResourceModules', 'ResourceModuleSkinStyles' ) as $setting ) {
+ if ( isset( $info[$setting] ) ) {
+ foreach ( $info[$setting] as $name => $data ) {
+ if ( isset( $data['localBasePath'] ) ) {
+ $data['localBasePath'] = "$dir/{$data['localBasePath']}";
+ }
+ if ( $defaultPaths ) {
+ $data += $defaultPaths;
+ }
+ $this->globals["wg$setting"][$name] = $data;
}
- if ( $defaultPaths ) {
- $data += $defaultPaths;
- }
- $this->globals['wgResourceModules'][$name] = $data;
}
}
}
'AutoloadClasses' => 'removeAbsolutePath',
'ExtensionCredits' => 'handleCredits',
'ResourceModules' => 'handleResourceModules',
+ 'ResourceModuleSkinStyles' => 'handleResourceModules',
'Hooks' => 'handleHooks',
'ExtensionFunctions' => 'handleExtensionFunctions',
);
),
),
),
+ // ResourceModuleSkinStyles with file module paths
+ array(
+ // Input
+ array(
+ 'ResourceFileModulePaths' => array(
+ 'localBasePath' => '',
+ 'remoteSkinPath' => 'FooBar',
+ ),
+ 'ResourceModuleSkinStyles' => array(
+ 'foobar' => array(
+ 'test.foo' => 'foo.css',
+ )
+ ),
+ ),
+ // Expected
+ array(
+ 'wgResourceModuleSkinStyles' => array(
+ 'foobar' => array(
+ 'test.foo' => 'foo.css',
+ 'localBasePath' => $dir,
+ 'remoteSkinPath' => 'FooBar',
+ ),
+ ),
+ ),
+ ),
+ // ResourceModuleSkinStyles with file module paths and an override
+ array(
+ // Input
+ array(
+ 'ResourceFileModulePaths' => array(
+ 'localBasePath' => '',
+ 'remoteSkinPath' => 'FooBar',
+ ),
+ 'ResourceModuleSkinStyles' => array(
+ 'foobar' => array(
+ 'test.foo' => 'foo.css',
+ 'remoteSkinPath' => 'BarFoo'
+ ),
+ ),
+ ),
+ // Expected
+ array(
+ 'wgResourceModuleSkinStyles' => array(
+ 'foobar' => array(
+ 'test.foo' => 'foo.css',
+ 'localBasePath' => $dir,
+ 'remoteSkinPath' => 'BarFoo',
+ ),
+ ),
+ ),
+ ),
);
}