You are here

public function OptionsShsWidget::settingsSummary in Simple hierarchical select 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Field/FieldWidget/OptionsShsWidget.php \Drupal\shs\Plugin\Field\FieldWidget\OptionsShsWidget::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

1 call to OptionsShsWidget::settingsSummary()
OptionsShsChosenWidget::settingsSummary in modules/shs_chosen/src/Plugin/Field/FieldWidget/OptionsShsChosenWidget.php
Returns a short summary for the current widget settings.
1 method overrides OptionsShsWidget::settingsSummary()
OptionsShsChosenWidget::settingsSummary in modules/shs_chosen/src/Plugin/Field/FieldWidget/OptionsShsChosenWidget.php
Returns a short summary for the current widget settings.

File

src/Plugin/Field/FieldWidget/OptionsShsWidget.php, line 121

Class

OptionsShsWidget
Plugin implementation of the 'options_shs' widget.

Namespace

Drupal\shs\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  if ($this
    ->getSetting('create_new_items')) {
    $summary[] = t('Allow creation of new items');
    if ($this
      ->getSetting('create_new_levels')) {
      $summary[] = t('Allow creation of new levels');
    }
    else {
      $summary[] = t('Do not allow creation of new levels');
    }
  }
  else {
    $summary[] = t('Do not allow creation of new items');
  }
  if ($this
    ->getSetting('force_deepest')) {
    $summary[] = t('Force selection of deepest level');
  }
  else {
    $summary[] = t('Do not force selection of deepest level');
  }
  return $summary;
}