You are here

function spamicide_admin_adform_form_submit in Spamicide 7

Same name and namespace in other branches
  1. 6 spamicide.module \spamicide_admin_adform_form_submit()

Implements hook_form_submit().

_values

Parameters

$form:

File

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

Code

function spamicide_admin_adform_form_submit($form, &$form_state) {
  module_load_include('inc', 'spamicide');

  // remove old settings
  db_delete('spamicide')
    ->condition('form_id', $form_state['values']['spamicide_form_id'])
    ->execute();

  // save new settings
  db_insert('spamicide')
    ->fields(array(
    'form_id' => $form_state['values']['spamicide_form_id'],
    'form_field' => $form_state['values']['spamicide_form_field'],
    'enabled' => 1,
  ))
    ->execute();
  _spamicide_set_css_file($form_state['values']['spamicide_form_field'], 'create');
  drupal_set_message(t('Saved Spamicide settings.'), 'status');

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