public function DateFieldWidgetBase::settingsForm in Date 8
Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::settingsForm().
2 calls to DateFieldWidgetBase::settingsForm()
- DateFieldDatepickerWidget::settingsForm in date_field/
lib/ Drupal/ date_field/ Plugin/ field/ widget/ DateFieldDatepickerWidget.php - Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::settingsForm().
- DateFieldListWidget::settingsForm in date_field/
lib/ Drupal/ date_field/ Plugin/ field/ widget/ DateFieldListWidget.php - Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::settingsForm().
2 methods override DateFieldWidgetBase::settingsForm()
- DateFieldDatepickerWidget::settingsForm in date_field/
lib/ Drupal/ date_field/ Plugin/ field/ widget/ DateFieldDatepickerWidget.php - Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::settingsForm().
- DateFieldListWidget::settingsForm in date_field/
lib/ Drupal/ date_field/ Plugin/ field/ widget/ DateFieldListWidget.php - Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::settingsForm().
File
- date_field/
lib/ Drupal/ date_field/ Plugin/ field/ widget/ DateFieldWidgetBase.php, line 67 - Definition of Drupal\date_field\Plugin\field\widget\DateFieldWidgetBase.
Class
- DateFieldWidgetBase
- Abstract class for all date widgets.
Namespace
Drupal\date_field\Plugin\field\widgetCode
public function settingsForm(array $form, array &$form_state) {
$field = $this->field;
$instance = $this->instance;
if (empty($settings['date_date_format'])) {
$settings['date_date_format'] = variable_get('date_format_html_date', 'Y-m-d') . ' ' . variable_get('date_format_html_time', 'H:i:s');
}
$element = array(
'#element_validate' => array(
'date_field_widget_settings_form_validate',
),
);
$element['year_range'] = array(
'#type' => 'date_year_range',
'#default_value' => $this
->getSetting('year_range'),
'#fieldset' => 'date_format',
'#weight' => 6,
);
$element['increment'] = array(
'#type' => 'select',
'#title' => t('Time increments'),
'#default_value' => $this
->getSetting('increment'),
'#options' => array(
1 => t('1 minute'),
5 => t('5 minute'),
10 => t('10 minute'),
15 => t('15 minute'),
30 => t('30 minute'),
),
'#weight' => 7,
'#fieldset' => 'date_format',
);
$context = array(
'field' => $field,
'instance' => $instance,
);
drupal_alter('date_field_widget_settings_form', $element, $context);
return $element;
}