function field_ui_field_edit_instance_pre_render

Pre-render function for field instance settings.

Combines the instance, widget, and other settings into a single fieldset so that elements within each group can be shown at different weights as if they all had the same parent.

1 string reference to 'field_ui_field_edit_instance_pre_render'
field_ui_field_edit_form in drupal/modules/field_ui/field_ui.admin.inc
Form constructor for the field instance settings form.

File

drupal/modules/field_ui/field_ui.admin.inc, line 1959
Administrative interface for custom field type creation.

Code

function field_ui_field_edit_instance_pre_render($element) {

  // Merge the widget settings into the main form.
  if (isset($element['widget']['settings'])) {
    foreach (element_children($element['widget']['settings']) as $key) {
      $element['widget_' . $key] = $element['widget']['settings'][$key];
    }
    unset($element['widget']['settings']);
  }

  // Merge the instance settings into the main form.
  if (isset($element['settings'])) {
    foreach (element_children($element['settings']) as $key) {
      $element['instance_' . $key] = $element['settings'][$key];
    }
    unset($element['settings']);
  }
  return $element;
}