You are here

function nd_field_delete_form_submit in Node displays 6

Delete field.

File

includes/nd.fields.inc, line 366
Manage fields.

Code

function nd_field_delete_form_submit($form, &$form_state) {
  $fields = variable_get('nd_fields', array());
  $field = $fields[$form_state['values']['field']];
  $action = $field['type'] == ND_FIELD_OVERRIDDEN ? t('reset') : t('deleted');
  unset($fields[$form_state['values']['field']]);
  variable_set('nd_fields', $fields);
  drupal_set_message(t('Field %field has been !action.', array(
    '%field' => $form_state['values']['field'],
    '!action' => $action,
  )));
  $form_state['redirect'] = 'admin/content/types/nd/fields';
}