1 date.module | date_form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id) |
Implements hook_form_FORM_ID_alter() for field_ui_field_edit_form().
File
- core/
modules/ date/ date.module, line 446 - Defines date/time field types.
Code
function date_form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id) {
$field = $form['#field'];
$instance = $form['#instance'];
if (!in_array($field['type'], array('date', 'datetime', 'datestamp'))) {
return;
}
// Reorganize the instance settings and widget settings sections into a more
// intuitive combined fieldset.
$form['instance']['date_format'] = array(
'#type' => 'fieldset',
'#title' => t('Date entry'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['instance']['default_values'] = array(
'#type' => 'fieldset',
'#title' => t('Default values'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['instance']['years_back_and_forward'] = array(
'#type' => 'fieldset',
'#title' => t('Starting and ending year'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['instance']['#pre_render'][] = 'date_field_ui_field_edit_form_pre_render';
}