You are here

public function EntityReferenceDragDropWidget::settingsSummary in Entity Reference Drag & Drop 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldWidget/EntityReferenceDragDropWidget.php \Drupal\entityreference_dragdrop\Plugin\Field\FieldWidget\EntityReferenceDragDropWidget::settingsSummary()

Returns a short summary for the current widget settings.

If an empty result is returned, a UI can still be provided to display a settings form in case the widget has configurable settings.

Return value

array A short summary of the widget settings.

Overrides WidgetBase::settingsSummary

File

src/Plugin/Field/FieldWidget/EntityReferenceDragDropWidget.php, line 124

Class

EntityReferenceDragDropWidget
Plugin implementation of the 'entityreference_dragdrop' widget.

Namespace

Drupal\entityreference_dragdrop\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = [];
  $view_mode = $this
    ->viewModeOptions()[$this
    ->getSetting('view_mode')];
  $summary[] = $this
    ->t('View mode: @view_mode', [
    '@view_mode' => $view_mode,
  ]);
  $summary[] = $this
    ->t('Available entities label: @label', [
    '@label' => $this
      ->getSetting('available_entities_label'),
  ]);
  $summary[] = $this
    ->t('Selected entities label: @label', [
    '@label' => $this
      ->getSetting('selected_entities_label'),
  ]);
  $summary[] = $this
    ->t('Display filter: @filter', [
    '@filter' => $this
      ->getSetting('display_filter') ? $this
      ->t('Yes') : $this
      ->t('No'),
  ]);
  return $summary;
}