Builds the default value widget for a given field instance.
function field_ui_default_value_widget($field, $instance, &$form, &$form_state) {
$field_name = $field['field_name'];
$entity = $form['#entity'];
$element = array(
'#type' => 'details',
'#title' => t('Default value'),
'#collapsible' => FALSE,
'#tree' => TRUE,
'#description' => t('The default value for this field, used when creating new content.'),
// Stick to an empty 'parents' on this form in order not to breaks widgets
// that do not use field_widget_[field|instance]() and still access
// $form_state['field'] directly.
'#parents' => array(),
);
// Adjust the instance definition used for the form element. We want a
// non-required input and no description.
$instance['required'] = FALSE;
$instance['description'] = '';
// Insert the widget. Since we do not use the "official" instance definition,
// the whole flow cannot use field_invoke_method().
$items = (array) $instance['default_value'];
$element += $instance
->getWidget()
->form($entity, LANGUAGE_NOT_SPECIFIED, $items, $element, $form_state);
return $element;
}