function chosen_form_field_ui_field_edit_form_alter in Chosen 7.3
Same name and namespace in other branches
- 6 chosen.module \chosen_form_field_ui_field_edit_form_alter()
- 7 chosen.module \chosen_form_field_ui_field_edit_form_alter()
- 7.2 chosen.module \chosen_form_field_ui_field_edit_form_alter()
Implements hook_form_FORM_ID_alter().
Attach the generated formular to the forminstance to make the field save our values in it's instance data column.
TODO: Replace CHOSEN_WIDGET constant by supported widgets by plugin.
See also
hook_field_widget_settings_form
File
- ./
chosen.module, line 138 - General functions and hook implementations.
Code
function chosen_form_field_ui_field_edit_form_alter(&$form, $form_state) {
if (isset($form['instance']['widget']['type']['#value'])) {
$type = $form['instance']['widget']['type']['#value'];
if (in_array($type, unserialize(CHOSEN_WIDGETS))) {
$field = $form['#field'];
$instance = field_info_instance($form['instance']['entity_type']['#value'], $form['instance']['field_name']['#value'], $form['instance']['bundle']['#value']);
$form['instance'] += chosen_field_widget_settings_form($instance);
}
}
}