You are here

public function WidgetSettings::getAllowedSettingsForAll in Maxlength 8

Returns all the settings which are allowed for all the widgets.

Overrides WidgetSettingsInterface::getAllowedSettingsForAll

1 call to WidgetSettings::getAllowedSettingsForAll()
WidgetSettings::getAllowedSettings in src/WidgetSettings.php

File

src/WidgetSettings.php, line 13

Class

WidgetSettings
The WidgetManager service.

Namespace

Drupal\maxlength

Code

public function getAllowedSettingsForAll() {
  $settings = array(
    'string_textfield' => array(
      'maxlength_setting' => TRUE,
      'summary_maxlength_setting' => FALSE,
      'truncate_setting' => FALSE,
    ),
    'string_textarea' => array(
      'maxlength_setting' => TRUE,
      'summary_maxlength_setting' => FALSE,
      'truncate_setting' => TRUE,
    ),
    'text_textfield' => array(
      'maxlength_setting' => TRUE,
      'summary_maxlength_setting' => FALSE,
      'truncate_setting' => FALSE,
    ),
    'text_textarea' => array(
      'maxlength_setting' => TRUE,
      'summary_maxlength_setting' => FALSE,
      'truncate_setting' => TRUE,
    ),
    'text_textarea_with_summary' => array(
      'maxlength_setting' => TRUE,
      'summary_maxlength_setting' => TRUE,
      'truncate_setting' => TRUE,
    ),
    'key_value_textarea' => array(
      'maxlength_setting' => TRUE,
      'summary_maxlength_setting' => TRUE,
      'truncate_setting' => TRUE,
    ),
    'link_default' => array(
      'maxlength_setting' => TRUE,
      'summary_maxlength_setting' => FALSE,
      'truncate_setting' => FALSE,
    ),
    'linkit' => array(
      'maxlength_setting' => TRUE,
      'summary_maxlength_setting' => FALSE,
      'truncate_setting' => FALSE,
    ),
  );
  $additional_widget_settings = \Drupal::moduleHandler()
    ->invokeAll('maxlength_widget_settings') ?: [];
  return $settings + $additional_widget_settings;
}