You are here

function insert_field_widget_third_party_settings_form in Insert 8.2

Implements hook_field_widget_third_party_settings_form().

File

./insert.module, line 37

Code

function insert_field_widget_third_party_settings_form(WidgetInterface $plugin) {
  $pluginId = $plugin
    ->getPluginId();
  if (InsertUtility::isSourceWidget($pluginId, [
    INSERT_TYPE_FILE,
    INSERT_TYPE_IMAGE,
  ])) {
    $insertType = _insert_get_insert_type($pluginId);
    if ($insertType === INSERT_TYPE_FILE) {
      $config = \Drupal::config('insert.config');
      if ($config
        ->get('file_field_images_enabled')) {
        $insertType = INSERT_TYPE_IMAGE;
      }
    }
    return _insert_settings_form(_insert_settings($plugin), $insertType);
  }
  return [];
}