You are here

function key_config_delete_confirm_submit in Key 7.3

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

Submit handler for key_config_delete_confirm().

File

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

Code

function key_config_delete_confirm_submit($form, &$form_state) {
  $id = isset($form_state['values']['id']) ? $form_state['values']['id'] : NULL;

  // Load the configuration, so the values can be used after deletion.
  $config = key_get_key($id);
  key_delete_key($id);
  $form_state['redirect'] = KEY_MENU_PATH;

  // Allow the plugins to perform additional actions.
  foreach (_key_get_plugin_types() as $type) {
    $plugin = key_get_plugin($type, $config[$type]);
    if ($submit_form_function = ctools_plugin_get_function($plugin, 'submit delete form')) {
      $submit_form_function($form, $form_state, $config);
    }
  }
}