You are here

function encrypt_config_delete_confirm in Encrypt 7.3

Same name and namespace in other branches
  1. 7.2 includes/encrypt.admin.inc \encrypt_config_delete_confirm()

Menu callback to delete an encryption configuration.

1 string reference to 'encrypt_config_delete_confirm'
encrypt_menu in ./encrypt.module
Implements hook_menu().

File

includes/encrypt.admin.inc, line 386
This file holds the functions for the Encrypt admin settings.

Code

function encrypt_config_delete_confirm($form, &$form_state, $config) {
  $default_config = variable_get('encrypt_default_config', NULL);
  if ($default_config == $config['name']) {
    drupal_set_message(t('The default configuration cannot be deleted.'), 'error');
    drupal_goto(ENCRYPT_MENU_PATH);
  }
  $form['name'] = array(
    '#type' => 'value',
    '#value' => $config['name'],
  );
  $form['label'] = array(
    '#type' => 'value',
    '#value' => $config['label'],
  );
  $message = t('Are you sure you want to delete the configuration %label?', array(
    '%label' => $config['label'],
  ));
  $caption = '<p>' . t('This action cannot be undone.') . '</p>';
  return confirm_form($form, filter_xss_admin($message), ENCRYPT_MENU_PATH, filter_xss_admin($caption), t('Delete'));
}