You are here

function ds_field_settings_form in Display Suite 8.3

Same name and namespace in other branches
  1. 8.4 includes/field_ui.inc \ds_field_settings_form()
  2. 8.2 includes/field_ui.inc \ds_field_settings_form()
  3. 7.2 includes/ds.field_ui.inc \ds_field_settings_form()
  4. 7 ds.field_ui.inc \ds_field_settings_form()

Creates a form for Display Suite fields.

Parameters

\Drupal\ds\Plugin\DsField\DsFieldInterface $plugin_instance: An instance of the plugin.

\Drupal\Core\Form\FormStateInterface $form_state: The form state of the form.

Return value

mixed The altered form.

1 call to ds_field_settings_form()
_ds_field_ui_fields in includes/field_ui.inc
Add the fields to the Field UI form.

File

includes/field_ui.inc, line 692
Field UI functions for Display Suite.

Code

function ds_field_settings_form(DsFieldInterface $plugin_instance, FormStateInterface $form_state) {

  // Create the form.
  $form = $plugin_instance
    ->settingsForm([], $form_state);

  // Add field template settings to every field if enabled.
  if (\Drupal::config('ds.settings')
    ->get('field_template')) {
    $context = [
      'instance' => [
        'entity_type' => $plugin_instance
          ->getEntityTypeId(),
        'bundle' => $plugin_instance
          ->bundle(),
        'field_name' => $plugin_instance
          ->getName(),
      ],
      'view_mode' => $plugin_instance
        ->viewMode(),
    ];
    ds_field_template_settings_form($form, $form_state, $context);
  }
  return $form;
}