function spamicide_admin_form_submit in Spamicide 5
Same name and namespace in other branches
- 6 spamicide.module \spamicide_admin_form_submit()
- 7 spamicide.module \spamicide_admin_form_submit()
Implementation of hook_form_submit
_values
Parameters
$form:
File
- ./
spamicide.module, line 227 - This module provides yet another tool to eliminate spam.
Code
function spamicide_admin_form_submit($form, $form_values) {
variable_set('spamicide_administration_mode', $form_values['spamicide_administration_mode']);
/*
* need to implement admin links yet
*/
foreach ($form_values['spamicide_forms'] as $spamicide_form_id => $data) {
if ($data['form_field'] != 'feed_me') {
_spamicide_set_css_file($data['form_field']);
/* $css_file = 'spamicide/'. $data['form_field'] .'.css';
$path = file_create_path($css_file);
if (!file_exists($path)) { // or !is_file or !file_exists or !file_check_location
$css = "#edit-". str_replace('_', '-', $data['form_field']) ."-wrapper\n{\n display: none;\n}\n";
file_save_data($css, $css_file, FILE_EXISTS_REPLACE);
}*/
}
db_query("UPDATE {spamicide} SET enabled = '%s', form_field = '%s' WHERE form_id = '%s'", $data['enabled'], $data['form_field'], $spamicide_form_id);
}
variable_set('spamicide_log_attempts', $form_values['spamicide_log_attempts']);
drupal_set_message(t('The Spamicide settings were saved.'), 'status');
}