You are here

public function SmartDateDefaultWidget::settingsSummary in Smart Date 3.3.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldWidget/SmartDateDefaultWidget.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateDefaultWidget::settingsSummary()
  2. 3.x src/Plugin/Field/FieldWidget/SmartDateDefaultWidget.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateDefaultWidget::settingsSummary()
  3. 3.0.x src/Plugin/Field/FieldWidget/SmartDateDefaultWidget.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateDefaultWidget::settingsSummary()
  4. 3.1.x src/Plugin/Field/FieldWidget/SmartDateDefaultWidget.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateDefaultWidget::settingsSummary()
  5. 3.2.x src/Plugin/Field/FieldWidget/SmartDateDefaultWidget.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateDefaultWidget::settingsSummary()
  6. 3.4.x src/Plugin/Field/FieldWidget/SmartDateDefaultWidget.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateDefaultWidget::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 SmartDateWidgetBase::settingsSummary

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

File

src/Plugin/Field/FieldWidget/SmartDateDefaultWidget.php, line 73

Class

SmartDateDefaultWidget
Plugin implementation of the 'smartdate_default' widget.

Namespace

Drupal\smart_date\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  if ($this->fieldDefinition
    ->getType() == 'daterange' && $this
    ->getSetting('default_duration')) {
    $summary[] = $this
      ->t('The default duration is @def_dur minutes.', [
      '@def_dur' => $this
        ->getSetting('default_duration'),
    ]);
  }
  return $summary;
}