function fieldgroup_update_fields in Content Construction Kit (CCK) 6.2
Same name and namespace in other branches
- 6.3 modules/fieldgroup/fieldgroup.module \fieldgroup_update_fields()
- 6 modules/fieldgroup/fieldgroup.module \fieldgroup_update_fields()
2 calls to fieldgroup_update_fields()
- content_copy_import_form_submit in modules/
content_copy/ content_copy.module - Submit handler for import form. For each submitted field: 1) add new field to the database 2) execute the imported field macro to update the settings to the imported values
- fieldgroup_field_overview_form_submit in modules/
fieldgroup/ fieldgroup.module
File
- modules/
fieldgroup/ fieldgroup.module, line 822 - Create field groups for CCK fields.
Code
function fieldgroup_update_fields($form_values) {
$default = _fieldgroup_field_get_group($form_values['type_name'], $form_values['field_name']);
if ($default != $form_values['group']) {
if ($form_values['group'] && !$default) {
db_query("INSERT INTO {" . fieldgroup_fields_tablename() . "} (type_name, group_name, field_name) VALUES ('%s', '%s', '%s')", $form_values['type_name'], $form_values['group'], $form_values['field_name']);
}
elseif ($form_values['group']) {
db_query("UPDATE {" . fieldgroup_fields_tablename() . "} SET group_name = '%s' WHERE type_name = '%s' AND field_name = '%s'", $form_values['group'], $form_values['type_name'], $form_values['field_name']);
}
else {
db_query("DELETE FROM {" . fieldgroup_fields_tablename() . "} WHERE type_name = '%s' AND field_name = '%s'", $form_values['type_name'], $form_values['field_name']);
}
cache_clear_all('fieldgroup_data:', content_cache_tablename(), TRUE);
}
}