You are here

public function DateTimeDatelistWidget::settingsSummary in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php \Drupal\datetime\Plugin\Field\FieldWidget\DateTimeDatelistWidget::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

File

core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php, line 141
Contains \Drupal\datetime\Plugin\Field\FieldWidget\DateTimeDatelistWidget.

Class

DateTimeDatelistWidget
Plugin implementation of the 'datetime_datelist' widget.

Namespace

Drupal\datetime\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = array();
  $summary[] = t('Date part order: @order', array(
    '@order' => $this
      ->getSetting('date_order'),
  ));
  if ($this
    ->getFieldSetting('datetime_type') == 'datetime') {
    $summary[] = t('Time type: @time_type', array(
      '@time_type' => $this
        ->getSetting('time_type'),
    ));
    $summary[] = t('Time increments: @increment', array(
      '@increment' => $this
        ->getSetting('increment'),
    ));
  }
  return $summary;
}