You are here

public function SmartDateWidgetBase::settingsSummary in Smart Date 3.4.x

Same name and namespace in other branches
  1. 3.0.x src/Plugin/Field/FieldWidget/SmartDateWidgetBase.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateWidgetBase::settingsSummary()
  2. 3.1.x src/Plugin/Field/FieldWidget/SmartDateWidgetBase.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateWidgetBase::settingsSummary()
  3. 3.2.x src/Plugin/Field/FieldWidget/SmartDateWidgetBase.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateWidgetBase::settingsSummary()
  4. 3.3.x src/Plugin/Field/FieldWidget/SmartDateWidgetBase.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateWidgetBase::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 SmartDateWidgetBase::settingsSummary()
SmartDateDefaultWidget::settingsSummary in src/Plugin/Field/FieldWidget/SmartDateDefaultWidget.php
Returns a short summary for the current widget settings.
2 methods override SmartDateWidgetBase::settingsSummary()
SmartDateDatelistWidget::settingsSummary in src/Plugin/Field/FieldWidget/SmartDateDatelistWidget.php
Returns a short summary for the current widget settings.
SmartDateDefaultWidget::settingsSummary in src/Plugin/Field/FieldWidget/SmartDateDefaultWidget.php
Returns a short summary for the current widget settings.

File

src/Plugin/Field/FieldWidget/SmartDateWidgetBase.php, line 65

Class

SmartDateWidgetBase
Base class for the 'smartdate_*' widgets.

Namespace

Drupal\smart_date\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $cardinality = $this->fieldDefinition
    ->getFieldStorageDefinition()
    ->getCardinality();
  if ($cardinality != 1 && !$this
    ->getSetting('show_extra')) {
    $summary[] = $this
      ->t('Suppress extra, empty widget.');
  }
  return $summary;
}