1 date.module date_field_ui_field_edit_form_pre_render($form)

Rearrange form elements into fieldsets for presentation only.

File

core/modules/date/date.module, line 399
Defines date/time field types.

Code

function date_field_ui_field_edit_form_pre_render($form) {
  foreach ($form as $name => $element) {
    if (is_array($element) && isset($element['#fieldset'])) {
      $fieldset = $element['#fieldset'];
      $form[$fieldset][$name] = $element;
      unset($form[$name]);
    }
  }
  foreach (array('date_format', 'default_values', 'years_back_and_forward') as $name) {
    if (element_children($form[$name])) {
      // Force the items in the fieldset to be resorted now that the instance
      // and widget settings are combined.
      $form[$name]['#sorted'] = FALSE;
      $form['defaults'][$name] = $form[$name];
    }
    unset($form[$name]);
  }
  return $form;
}