You are here

function ds_field_settings_summary in Display Suite 8.3

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

Creates a summary for the field format configuration summary.

Parameters

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

array $settings: The passed settings.

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

Return value

array The summary.

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

File

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

Code

function ds_field_settings_summary(DsFieldInterface $plugin_instance, array $settings, FormStateInterface $form_state) {

  // Create the form.
  $summary = $plugin_instance
    ->settingsSummary($settings);

  // Add field template summary.
  ds_field_formatter_settings_summary_alter($summary, [
    'field_definition' => $plugin_instance,
    'form_state' => $form_state,
  ]);
  if (empty($summary)) {
    return [];
  }
  return [
    '#type' => 'inline_template',
    '#template' => '<div class="field-plugin-summary">{{ summary|safe_join("<br />") }}</div>',
    '#context' => [
      'summary' => $summary,
    ],
    '#cell_attributes' => [
      'class' => [
        'field-plugin-summary-cell',
      ],
    ],
  ];
}