You are here

function botcha_point_disable_confirm_submit in BOTCHA Spam Prevention 6

Same name and namespace in other branches
  1. 7 botcha.pages.inc \botcha_point_disable_confirm_submit()

Submission handler of BOTCHA point disabling/deleting confirm_form.

File

./botcha.pages.inc, line 400
Implementation of botcha administration forms.

Code

function botcha_point_disable_confirm_submit($form, &$form_state) {
  $botcha_point_form_id = $form_state['values']['botcha_point_form_id'];
  $delete = $form_state['values']['botcha_point_delete'];
  if ($delete) {
    botcha_set_form_id_setting($botcha_point_form_id, NULL);
    drupal_set_message(t('Deleted BOTCHA for form %form_id.', array(
      '%form_id' => $botcha_point_form_id,
    )));
  }
  else {
    botcha_set_form_id_setting($botcha_point_form_id, 'none');
    drupal_set_message(t('Disabled BOTCHA for form %form_id.', array(
      '%form_id' => $botcha_point_form_id,
    )));
  }
  $form_state['redirect'] = 'admin/user/botcha/botcha';
}