function ds_remove_fields_form in Display Suite 7.2
Same name and namespace in other branches
- 7 ds.fields.inc \ds_remove_fields_form()
Confirmation delete or revert form.
2 calls to ds_remove_fields_form()
- ds_delete_field_confirm in modules/
ds_ui/ includes/ ds.fields.inc - Menu callback: Confirmation custom field delete form.
- ds_revert_field_confirm in modules/
ds_ui/ includes/ ds.fields.inc - Menu callback: Confirmation custom field delete form.
File
- modules/
ds_ui/ includes/ ds.fields.inc, line 499 - Administrative functions for managing custom fields for every entity.
Code
function ds_remove_fields_form($form, &$form_state, $field = '', $action = 'delete') {
ctools_include('export');
$custom_fields = ctools_export_crud_load_all('ds_fields');
if (isset($custom_fields[$field])) {
$field = $custom_fields[$field];
$form['#ds_field'] = $field;
return confirm_form($form, t('Are you sure you want to ' . $action . ' %field?', array(
'%field' => $field->label,
)), 'admin/structure/ds/fields', t('This action cannot be undone.'), t(drupal_ucfirst($action)), t('Cancel'));
}
else {
drupal_set_message(t('Unknown field'));
drupal_goto('admin/structure/ds/fields');
}
}