You are here

private static function LayouterTextFormat::layouterActiveTextFormats in Layouter - WYSIWYG layout templates 8

Gets the list of text formats for which Layouter is enabled.

Return value

array Array of allowed formats.

1 call to LayouterTextFormat::layouterActiveTextFormats()
LayouterTextFormat::layouterLoadByField in src/LayouterTextFormat.php
Enables Layouter for given textarea field.

File

src/LayouterTextFormat.php, line 97

Class

LayouterTextFormat
Provides a trusted callback.

Namespace

Drupal\layouter

Code

private static function layouterActiveTextFormats() {
  $layouter_text_formats = \Drupal::config('layouter.settings')
    ->get('text_formats');
  $text_formats_enabled = [];
  if ($layouter_text_formats) {
    foreach ($layouter_text_formats as $text_format) {
      if ($text_format) {
        $text_formats_enabled[] = $text_format;
      }
    }
  }
  return $text_formats_enabled;
}