You are here

function spamicide_delete_confirm_submit in Spamicide 7

Same name and namespace in other branches
  1. 5 spamicide.module \spamicide_delete_confirm_submit()
  2. 6 spamicide.module \spamicide_delete_confirm_submit()

submission handler of Spamicide delete confirm_form

File

./spamicide.module, line 345
This module provides yet another tool to eliminate spam.

Code

function spamicide_delete_confirm_submit($form, &$form_state) {
  $spamicide_form_id = $form_state['values']['spamicide_form_id'];
  $spamicide_form_field = db_query('SELECT form_field FROM {spamicide} WHERE form_id = :form_id', array(
    ':form_id' => $spamicide_form_id,
  ))
    ->fetchField();
  db_delete('spamicide')
    ->condition('form_id', $form_state['values']['spamicide_form_id'])
    ->execute();
  _spamicide_set_css_file($spamicide_form_field, 'delete');
  drupal_set_message(t('Spamicide protection for form %form_id has been removed.', array(
    '%form_id' => $spamicide_form_id,
  )));

  // redirect to general Spamicide settings page after deletion
  drupal_goto('admin/config/people/spamicide');
}