35 if ( isset( $options[
'themeScripts'] ) ) {
39 if ( isset( $options[
'themeStyles'] ) ) {
40 $this->themeStyles = $this->
getSkinSpecific( $options[
'themeStyles'],
'styles' );
43 parent::__construct( $options );
49 $this->skinStyles = $this->
extendSkinSpecific( $this->skinStyles, $this->themeStyles );
64 array_keys( $themes ),
65 array_map(
function ( $theme ) use ( $module, $which ) {
66 if ( $which ===
'scripts' ) {
71 }, array_values( $themes ) )
96 foreach ( $skinSpecific as $skin => $files ) {
97 if ( !is_array( $files ) ) {
100 if ( isset( $themeSpecific[$skin] ) ) {
101 $skinSpecific[$skin] = array_merge( [ $themeSpecific[$skin] ], $files );
102 } elseif ( isset( $themeSpecific[
'default'] ) ) {
103 $skinSpecific[$skin] = array_merge( [ $themeSpecific[
'default'] ], $files );
107 foreach ( $themeSpecific as $skin =>
$file ) {
108 if ( !isset( $skinSpecific[$skin] ) ) {
109 $skinSpecific[$skin] = [
$file ];
112 return $skinSpecific;
static getSkinThemeMap()
Return a map of skin names (in lowercase) to OOUI theme names, defining which theme a given skin shou...
getThemeScriptsPath( $theme, $module)
getThemeStylesPath( $theme, $module)
Module based on local JavaScript/CSS files.
array $skinScripts
List of JavaScript files to include when using a specific skin.
Module which magically loads the right skinScripts and skinStyles for every skin, using the specified...
getSkinSpecific( $module, $which)
Helper function to generate values for 'skinStyles' and 'skinScripts'.
array< string, string|ResourceLoaderFilePath > $themeStyles
__construct(array $options=[])
extendSkinSpecific(array $skinSpecific, array $themeSpecific)
Prepend theme-specific resources on behalf of the skin.
setSkinStylesOverride(array $moduleSkinStyles)
Provide overrides for skinStyles to modules that support that.
trait ResourceLoaderOOUIModule
Convenience methods for dealing with OOUI themes and their relations to MW skins.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.