You are here

function flag_delete_confirm_submit in Flag 7.3

Same name and namespace in other branches
  1. 5 includes/flag.admin.inc \flag_delete_confirm_submit()
  2. 6.2 includes/flag.admin.inc \flag_delete_confirm_submit()
  3. 6 includes/flag.admin.inc \flag_delete_confirm_submit()
  4. 7.2 includes/flag.admin.inc \flag_delete_confirm_submit()

File

includes/flag.admin.inc, line 781
Contains administrative pages for creating, editing, and deleting flags.

Code

function flag_delete_confirm_submit($form, &$form_state) {
  $flag = $form['#flag'];
  if ($form_state['values']['confirm']) {
    $flag
      ->delete();
    $flag
      ->disable();
    _flag_clear_cache($flag->entity_type, TRUE);
  }
  drupal_set_message(t('Flag @name has been deleted.', array(
    '@name' => $flag
      ->get_title(),
  )));
  $form_state['redirect'] = FLAG_ADMIN_PATH;
}