definition === null ) { return; } // Check to make sure icons are set if ( !isset( $this->definition['icons'] ) ) { throw new RuntimeException( 'Icons must be set.' ); } $images = []; foreach ( $this->definition['icons'] as $iconName => $definition ) { // FIXME: We also have a 'site' icon which is "magical" // and uses witchcraft and should be handled specifically if ( isset( $definition[ 'path' ] ) ) { if ( is_array( $definition[ 'path' ] ) ) { $paths = []; foreach ( $definition[ 'path' ] as $dir => $p ) { // Has both rtl and ltr definitions $paths[ $dir ] = $p; } } else { $paths = $definition[ 'path' ]; } if ( !empty( $paths ) ) { $images[ $iconName ][ 'file' ] = $paths; } } } $this->definition[ 'images' ] = $images; $this->definition[ 'selector' ] = '.oo-ui-icon-{name}'; parent::loadFromDefinition(); } }