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' ] ) && $definition[ 'path' ] ) { // string or array, if array, has both rtl and ltr definitions $images[ $iconName ][ 'file' ] = $definition[ 'path' ]; } } $this->definition[ 'images' ] = $images; $this->definition[ 'selector' ] = '.oo-ui-icon-{name}'; parent::loadFromDefinition(); } }