/** * Prerender function for the instance settings. * * Combine 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. */ 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; }