public function SmartDateTimezoneWidget::settingsSummary in Smart Date 8.2
Same name and namespace in other branches
- 3.x src/Plugin/Field/FieldWidget/SmartDateTimezoneWidget.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateTimezoneWidget::settingsSummary()
- 3.0.x src/Plugin/Field/FieldWidget/SmartDateTimezoneWidget.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateTimezoneWidget::settingsSummary()
- 3.1.x src/Plugin/Field/FieldWidget/SmartDateTimezoneWidget.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateTimezoneWidget::settingsSummary()
- 3.2.x src/Plugin/Field/FieldWidget/SmartDateTimezoneWidget.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateTimezoneWidget::settingsSummary()
- 3.3.x src/Plugin/Field/FieldWidget/SmartDateTimezoneWidget.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateTimezoneWidget::settingsSummary()
- 3.4.x src/Plugin/Field/FieldWidget/SmartDateTimezoneWidget.php \Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateTimezoneWidget::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 SmartDateDefaultWidget::settingsSummary
File
- src/
Plugin/ Field/ FieldWidget/ SmartDateTimezoneWidget.php, line 103
Class
- SmartDateTimezoneWidget
- Plugin implementation of the 'smartdate_timezone' widget.
Namespace
Drupal\smart_date\Plugin\Field\FieldWidgetCode
public function settingsSummary() {
$summary = parent::settingsSummary();
switch ($this
->getSetting('default_tz')) {
case '':
$summary[] = $this
->t("The site's timezone will be used unless overridden");
break;
case 'user':
$summary[] = $this
->t("The user's timezone will be used by default");
break;
case 'custom':
$summary[] = $this
->t('Custom default timezone: @custom_tz', [
'@custom_tz' => $this
->getSetting('custom_tz'),
]);
break;
}
return $summary;
}