function signup_settings_page_submit in Signup 5
Same name and namespace in other branches
- 5.2 signup.module \signup_settings_page_submit()
Submits the signup settings form
Parameters
$form_id The ID of the form being submitted.:
$form_values The constructed form values array of the submitted form.:
File
- ./
signup.module, line 922
Code
function signup_settings_page_submit($form_id, $form_values) {
$op = isset($form_values['op']) ? $form_values['op'] : '';
if ($op == t('Save configuration') && db_num_rows(db_query('SELECT nid FROM {signup} WHERE nid = 0'))) {
db_query("UPDATE {signup} SET forwarding_email = '%s', send_confirmation = %d, confirmation_email = '%s', send_reminder = %d, reminder_days_before = %d, reminder_email = '%s' WHERE nid = 0", $form_values['signup_forwarding_email'], $form_values['signup_send_confirmation'], $form_values['signup_confirmation_email'], $form_values['signup_send_reminder'], $form_values['signup_reminder_days_before'], $form_values['signup_reminder_email']);
}
else {
require_once 'signup.install';
db_query("DELETE FROM {signup} WHERE nid = 0");
signup_insert_default_signup_info();
}
// Now, remove all the settings we just processed from our copy of
// $form_values, so system_settings_form_submit() doesn't see them.
$settings = array(
'signup_forwarding_email',
'signup_send_confirmation',
'signup_confirmation_email',
'signup_send_reminder',
'signup_reminder_days_before',
'signup_reminder_email',
);
foreach ($settings as $setting) {
unset($form_values[$setting]);
}
// Remove the hidden element from _signup_admin_form(), too.
unset($form_values['signup']);
// Finally, let system_settings_form_submit() do its magic with the
// rest of the settings.
system_settings_form_submit($form_id, $form_values);
}