31 if ( isset(
$options[
'themeScripts' ] ) ) {
33 if ( !isset(
$options[
'skinScripts'] ) ) {
38 if ( isset(
$options[
'themeStyles' ] ) ) {
40 if ( !isset(
$options[
'skinStyles'] ) ) {
61 array_keys( $themes ),
62 array_map(
function ( $theme ) use ( $module, $which ) {
63 if ( $which ===
'scripts' ) {
68 }, array_values( $themes ) )
81 foreach ( $skinSpecific as $skin => $files ) {
82 if ( !is_array( $files ) ) {
85 if ( isset( $extraSkinSpecific[$skin] ) ) {
86 $skinSpecific[
$skin] = array_merge( [ $extraSkinSpecific[$skin] ], $files );
87 } elseif ( isset( $extraSkinSpecific[
'default'] ) ) {
88 $skinSpecific[
$skin] = array_merge( [ $extraSkinSpecific[
'default'] ], $files );
92 foreach ( $extraSkinSpecific as $skin => $file ) {
93 if ( !isset( $skinSpecific[$skin] ) ) {
94 $skinSpecific[
$skin] = $file;
static getSkinThemeMap()
Return a map of skin names (in lowercase) to OOUI theme names, defining which theme a given skin shou...
trait ResourceLoaderOOUIModule
Convenience methods for dealing with OOUI themes and their relations to MW skins.
getThemeScriptsPath( $theme, $module)
getThemeStylesPath( $theme, $module)
ResourceLoader module based on local JavaScript/CSS files.
array $skinStyles
List of paths to CSS files to include when using specific skins.
array $skinScripts
List of JavaScript files to include when using a specific skin.
ResourceLoaderFileModule which magically loads the right skinScripts and skinStyles for every skin,...
__construct( $options=[])
extendSkinSpecific(&$skinSpecific, $extraSkinSpecific)
Prepend the $extraSkinSpecific assoc.
getSkinSpecific( $module, $which)
Helper function to generate values for 'skinStyles' and 'skinScripts'.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned $skin