function ds_fieldgroup_delete_form_submit in Display Suite 6.2
Same name and namespace in other branches
- 6.3 includes/ds.groups.inc \ds_fieldgroup_delete_form_submit()
- 6 includes/ds.groups.inc \ds_fieldgroup_delete_form_submit()
Delete build mode.
File
- includes/
ds.groups.inc, line 245 - Manage fieldgroups.
Code
function ds_fieldgroup_delete_form_submit($form, &$form_state) {
$module = $form['#module'];
$fields = variable_get($module . '_fields', array());
$fieldgroup = $form_state['values']['fieldgroup'];
$field_title = $fields[$fieldgroup]['title'];
// Save and invalidate fields_cached.
unset($fields[$fieldgroup]);
variable_set($module . '_fields', $fields);
ds_reset_fields_cache();
drupal_set_message(t('Fieldgroup %fieldgroup has been deleted.', array(
'%fieldgroup' => $field_title,
)));
$form_state['redirect'] = DS_PATH_MODULES . '/' . $form['#module'] . '/fieldgroups';
}