You are here

function key_config_delete_confirm in Key 7.3

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

Menu callback to delete a key configuration.

Parameters

array $config: The configuration to delete.

Return value

array The delete confirmation form.

1 string reference to 'key_config_delete_confirm'
key_menu in ./key.module
Implements hook_menu().

File

includes/key.admin.inc, line 436
Administrative functionality for managing key configurations.

Code

function key_config_delete_confirm($form, &$form_state, $config) {
  $form['id'] = array(
    '#type' => 'value',
    '#value' => $config['id'],
  );
  $form['label'] = array(
    '#type' => 'value',
    '#value' => $config['label'],
  );
  $message = t('Are you sure you want to delete the key %label?', array(
    '%label' => $config['label'],
  ));
  $caption = '<p>' . t('This action cannot be undone.') . '</p>';

  // Allow the plugins to modify the form.
  foreach (_key_get_plugin_types() as $type) {
    $plugin = key_get_plugin($type, $config[$type]);
    if ($delete_form_function = ctools_plugin_get_function($plugin, 'build delete form')) {
      $delete_form_function($form, $form_state, $config, $message, $caption);
    }
  }
  return confirm_form($form, filter_xss_admin($message), KEY_MENU_PATH, filter_xss_admin($caption), t('Delete'));
}