public function mapConfig(array $enabledCustomTags)
    {
        $config = [];
        foreach ($enabledCustomTags as $tagName) {
            if (!isset($this->customTagsConfiguration[$tagName])) {
                throw new RuntimeException(
                    "RichText Custom Tag configuration for {$tagName} not found."
                );
            }

            $customTagConfiguration = $this->customTagsConfiguration[$tagName];

            $config[$tagName] = [
                'label' => "ezrichtext.custom_tags.{$tagName}.label",
                'description' => "ezrichtext.custom_tags.{$tagName}.description",
                'isInline' => $customTagConfiguration['is_inline'],
            ];

            if (!empty($customTagConfiguration['icon'])) {
                $config[$tagName]['icon'] = $this->packages->getUrl(
                    $customTagConfiguration['icon']
                );
            }

            foreach ($customTagConfiguration['attributes'] as $attributeName => $properties) {
                $typeMapper = $this->getAttributeTypeMapper(
                    $tagName,
                    $attributeName,
                    $properties['type']
                );
                $config[$tagName]['attributes'][$attributeName] = $typeMapper->mapConfig(
                    $tagName,
                    $attributeName,
                    $properties
                );
            }
        }

        return $this->translateLabels($config);
    }
public function mapConfig(array $enabledCustomTags)
    {
        $config = [];
        foreach ($enabledCustomTags as $tagName) {
            if (!isset($this->customTagsConfiguration[$tagName])) {
                throw new RuntimeException(
                    "RichText Custom Tag configuration for {$tagName} not found."
                );
            }

            $customTagConfiguration = $this->customTagsConfiguration[$tagName];

            $config[$tagName] = [
                'label' => "ezrichtext.custom_tags.{$tagName}.label",
                'description' => "ezrichtext.custom_tags.{$tagName}.description",
                'isInline' => $customTagConfiguration['is_inline'],
            ];

            if (!empty($customTagConfiguration['icon'])) {
                $config[$tagName]['icon'] = $this->packages->getUrl(
                    $customTagConfiguration['icon']
                );
            }

            foreach ($customTagConfiguration['attributes'] as $attributeName => $properties) {
                $typeMapper = $this->getAttributeTypeMapper(
                    $tagName,
                    $attributeName,
                    $properties['type']
                );
                $config[$tagName]['attributes'][$attributeName] = $typeMapper->mapConfig(
                    $tagName,
                    $attributeName,
                    $properties
                );
            }
        }

        return $this->translateLabels($config);
    }
public function mapConfig ( array $ enabledCustomTags ) { $ config = [ ] ; foreach ( $ enabledCustomTags as $ tagName ) { if ( ! isset ( $ this -> customTagsConfiguration [ $ tagName ] ) ) { throw new RuntimeException ( "RichText Custom Tag configuration for {$tagName} not found." ) ; } $ customTagConfiguration = $ this -> customTagsConfiguration [ $ tagName ] ; $ config [ $ tagName ] = [ 'label' => "ezrichtext.custom_tags.{$tagName}.label" , 'description' => "ezrichtext.custom_tags.{$tagName}.description" , 'isInline' => $ customTagConfiguration [ 'is_inline' ] , ] ; if ( ! empty ( $ customTagConfiguration [ 'icon' ] ) ) { $ config [ $ tagName ] [ 'icon' ] = $ this -> packages -> getUrl ( $ customTagConfiguration [ 'icon' ] ) ; } foreach ( $ customTagConfiguration [ 'attributes' ] as $ attributeName => $ properties ) { $ typeMapper = $ this -> getAttributeTypeMapper ( $ tagName , $ attributeName , $ properties [ 'type' ] ) ; $ config [ $ tagName ] [ 'attributes' ] [ $ attributeName ] = $ typeMapper -> mapConfig ( $ tagName , $ attributeName , $ properties ) ; } } return $ this -> translateLabels ( $ config ) ; }
Map Configuration for the given list of enabled Custom Tags.

@param array $enabledCustomTags

@return array Mapped configuration
Map Configuration for the given list of enabled Custom Tags .