function ds_field_delete_reset_form_submit in Display Suite 6
Same name and namespace in other branches
- 6.3 includes/ds.fields.inc \ds_field_delete_reset_form_submit()
- 6.2 includes/ds.fields.inc \ds_field_delete_reset_form_submit()
Delete or reset a field.
File
- includes/
ds.fields.inc, line 717 - Manage fields.
Code
function ds_field_delete_reset_form_submit($form, &$form_state) {
$module = $form['#module'];
$fields = variable_get($module . '_fields', array());
$field = $fields[$form_state['values']['field']];
$field_title = $field['title'];
$action = $field['status'] == DS_FIELD_STATUS_OVERRIDDEN ? t('reset') : t('deleted');
// Save and invalidate fields_cached.
unset($fields[$form_state['values']['field']]);
variable_set($module . '_fields', $fields);
variable_del('ds_fields_cached');
drupal_set_message(t('Field %field has been !action.', array(
'%field' => $field_title,
'!action' => $action,
)));
$form_state['redirect'] = 'admin/build/ds/' . $form['#module'] . '/fields';
}