definition === null ) { return; } // Check to make sure icons are set if ( !isset( $this->definition['icons'] ) ) { throw new MWException( '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 $paths = ''; if ( isset( $definition[ 'path' ] ) ) { if ( is_array( $definition[ 'path' ] ) ) { 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 parent::loadFromDefinition(); } }