You are here

function values_delete_confirm in Values 7

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

Confirmation form to delete a value object from the database.

1 string reference to 'values_delete_confirm'
values_menu in ./values.module
Implements hook_menu().

File

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

Code

function values_delete_confirm($form, &$form_state, $value_set) {
  $form['value_set'] = array(
    '#type' => 'value',
    '#value' => $value_set,
  );
  $action = 'delete';

  // If ctools is installed we need to handle the delete link specially.
  if (module_exists('ctools')) {
    if ($value_set->export_type > 1) {
      $action = 'revert';
    }
  }
  return confirm_form($form, t('Are you sure you want to !action !name?', array(
    '!action' => $action,
    '!name' => $value_set->name,
  )), 'admin/structure/values', t('This action cannot be undone.'), t('!action', array(
    '!action' => ucwords($action),
  )), t('Cancel'));
}