function field_tools_field_clone_form_submit in Field tools 7
Same name and namespace in other branches
- 8 field_tools.admin.inc \field_tools_field_clone_form_submit()
Submit handler for the field clone form.
File
- ./
field_tools.admin.inc, line 713 - Contains admin callbacks for the Field tools module.
Code
function field_tools_field_clone_form_submit($form, &$form_state) {
$instance = $form['#instance'];
$field_name = $instance['field_name'];
$field = field_info_field($field_name);
$new_instances = array();
foreach (array_filter($form_state['values']['bundles']) as $option_key) {
list($entity_type, $bundle_type) = explode(':', $option_key);
$new_instances[$entity_type][] = $bundle_type;
}
if (!empty($new_instances)) {
_field_tools_add_instance_to_bundles($instance, $new_instances);
}
}