You are here

public static function InsertUtility::addEditorExtraAllowedContent in Insert 8.2

Adds allowed content (tags, attributes) to the editor settings.

Parameters

array $settings:

array $extraAllowedContent:

3 calls to InsertUtility::addEditorExtraAllowedContent()
insert_colorbox_editor_js_settings_alter in modules/insert_colorbox/insert_colorbox.module
Implements hook_editor_js_settings_alter().
insert_editor_js_settings_alter in ./insert.module
Implements hook_editor_js_settings_alter().
insert_responsive_image_editor_js_settings_alter in modules/insert_responsive_image/insert_responsive_image.module
Implements hook_editor_js_settings_alter().

File

src/Utility/InsertUtility.php, line 147

Class

InsertUtility

Namespace

Drupal\insert\Utility

Code

public static function addEditorExtraAllowedContent(array &$settings, array $extraAllowedContent) {
  $config = \Drupal::config('insert.config');
  $text_formats = $config
    ->get('text_formats');
  foreach (array_keys($settings['editor']['formats']) as $text_format_id) {
    if (in_array($text_format_id, $text_formats)) {
      static::combineEditorExtraAllowedContent($settings['editor']['formats'][$text_format_id]['editorSettings']['extraAllowedContent'], $extraAllowedContent);
    }
  }
}