You are here

function values_delete_confirm_submit in Values 7

Same name and namespace in other branches
  1. 6 values.module \values_delete_confirm_submit()

Calls deletion of a value object.

File

./values.module, line 422
API for managing reusable value sets.

Code

function values_delete_confirm_submit(&$form, &$form_state) {
  $value_set = $form_state['values']['value_set'];
  values_delete($value_set);
  $form_state['redirect'] = 'admin/structure/values';
  $action = 'deleted';

  // If ctools is installed we need to change the language a bit of the message
  if (module_exists('ctools')) {
    if ($value_set->export_type > 1) {
      $action = 'reverted';
    }
  }
  drupal_set_message(t('Value list !name was !action.', array(
    '!action' => $action,
    '!name' => $value_set->name,
  )));
}