summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/contact.module23
-rw-r--r--modules/contact/contact.module23
2 files changed, 4 insertions, 42 deletions
diff --git a/modules/contact.module b/modules/contact.module
index f05f25419..da34b83e0 100644
--- a/modules/contact.module
+++ b/modules/contact.module
@@ -289,27 +289,8 @@ function contact_admin_settings() {
$form['reset'] = array('#type' => 'submit',
'#value' => t('Reset to defaults'),
);
- return drupal_get_form('contact_admin_settings', $form);
-}
-
-/**
- * Process settings form submission.
- */
-function contact_admin_settings_submit($form_id, $form_values) {
- $op = isset($_POST['op']) ? $_POST['op'] : '';
-
- if ($op == t('Reset to defaults')) {
- foreach ($form_values as $key => $value) {
- variable_del($key);
- }
- drupal_set_message(t('The configuration options have been reset to their default values.'));
- }
- else {
- foreach ($form_values as $key => $value) {
- variable_set($key, $value);
- }
- drupal_set_message(t('The configuration options have been saved.'));
- }
+ // Use system_settings_form for the callback.
+ return drupal_get_form('contact_admin_settings', $form, 'system_settings_form');
}
/**
diff --git a/modules/contact/contact.module b/modules/contact/contact.module
index f05f25419..da34b83e0 100644
--- a/modules/contact/contact.module
+++ b/modules/contact/contact.module
@@ -289,27 +289,8 @@ function contact_admin_settings() {
$form['reset'] = array('#type' => 'submit',
'#value' => t('Reset to defaults'),
);
- return drupal_get_form('contact_admin_settings', $form);
-}
-
-/**
- * Process settings form submission.
- */
-function contact_admin_settings_submit($form_id, $form_values) {
- $op = isset($_POST['op']) ? $_POST['op'] : '';
-
- if ($op == t('Reset to defaults')) {
- foreach ($form_values as $key => $value) {
- variable_del($key);
- }
- drupal_set_message(t('The configuration options have been reset to their default values.'));
- }
- else {
- foreach ($form_values as $key => $value) {
- variable_set($key, $value);
- }
- drupal_set_message(t('The configuration options have been saved.'));
- }
+ // Use system_settings_form for the callback.
+ return drupal_get_form('contact_admin_settings', $form, 'system_settings_form');
}
/**