parent
26612e9cbd
commit
6ca5a9a2f5
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue