You are here

function user_badges_delete_form_submit in User Badges 6

Same name and namespace in other branches
  1. 5 user_badges.module \user_badges_delete_form_submit()
  2. 6.2 user_badges.module \user_badges_delete_form_submit()
  3. 7 user_badges.admin.inc \user_badges_delete_form_submit()
  4. 7.2 user_badges.admin.inc \user_badges_delete_form_submit()
  5. 7.3 user_badges.admin.inc \user_badges_delete_form_submit()

File

./user_badges.module, line 880
@brief User Badges module file

Code

function user_badges_delete_form_submit($form, &$form_state) {
  $bid = $form_state['values']['bid'];
  db_query("DELETE FROM {user_badges_badges} WHERE bid = %d", $bid);
  db_query("DELETE FROM {user_badges_user} WHERE bid = %d", $bid);
  db_query("DELETE FROM {user_badges_roles} WHERE bid = %d", $bid);
  drupal_set_message(t('Badge deleted.'));
  $form_state['redirect'] = 'admin/user/user_badges';
}