You are here

public function OptionsShsChosenWidget::settingsSummary in Simple hierarchical select 8

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

File

modules/shs_chosen/src/Plugin/Field/FieldWidget/OptionsShsChosenWidget.php, line 99

Class

OptionsShsChosenWidget
Plugin implementation of the 'options_shs_chosen' widget.

Namespace

Drupal\shs_chosen\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  if ($this
    ->getSetting('chosen_override')) {
    $summary[] = $this
      ->t('Override chosen settings');
  }
  else {
    $summary[] = $this
      ->t('Use <a href=":url">global chosen settings</a>', [
      ':url' => Url::fromRoute('chosen.admin')
        ->toString(),
    ]);
  }
  return $summary;
}