31 if ( $this->definition ===
null ) {
39 $module = $this->definition[
'themeImages'] ??
'';
42 foreach ( $themes as $skin => $theme ) {
51 foreach ( $data as $key => $value ) {
65 "Mismatched OOUI theme images definition: " .
66 "key '$key' of theme '$theme' for module '$module' " .
67 "does not match other themes"
76 if ( substr( $module, 0, 5 ) ===
'icons' ) {
77 $definition[
'selectorWithoutVariant'] =
'.oo-ui-icon-{name}, .mw-ui-icon-{name}:before';
78 $definition[
'selectorWithVariant'] =
'.oo-ui-image-{variant}.oo-ui-icon-{name}, ' .
79 '.mw-ui-icon-{name}-{variant}:before';
85 parent::loadFromDefinition();
106 $this->definition[
'rootPath'] .
'/' .
107 strtolower( $theme ) .
'/' .
108 $this->definition[
'name'] .
'.json';
124 if ( !file_exists( $localDataPath ) ) {
128 $data = json_decode( file_get_contents( $localDataPath ),
true );
132 $fixPath =
function ( &
$path ) use ( $dataPath ) {
135 dirname( $dataPath->getPath() ) .
'/' .
$path,
136 $dataPath->getLocalBasePath(),
137 $dataPath->getRemoteBasePath()
143 array_walk( $data[
'images'],
function ( &$value ) use ( $fixPath ) {
144 if ( is_string( $value[
'file'] ) ) {
145 $fixPath( $value[
'file'] );
146 } elseif ( is_array( $value[
'file'] ) ) {
147 array_walk_recursive( $value[
'file'], $fixPath );