summaryrefslogtreecommitdiff
path: root/modules/system/system.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-06-26 21:32:20 +0000
committerDries Buytaert <dries@buytaert.net>2010-06-26 21:32:20 +0000
commite27e1a0e0df1e070d8172921461b815317f4bfaa (patch)
tree4136c973a3c66295ce8e4a6853e08faf7111283f /modules/system/system.module
parent218c363c5a79fdfe5c0d8867f0f1c0c4b973a724 (diff)
downloadbrdo-e27e1a0e0df1e070d8172921461b815317f4bfaa.tar.gz
brdo-e27e1a0e0df1e070d8172921461b815317f4bfaa.tar.bz2
- Patch #266246 by sun, effulgentsia, marcingy: remove smart defaults for system_settings_form().
Diffstat (limited to 'modules/system/system.module')
-rw-r--r--modules/system/system.module27
1 files changed, 1 insertions, 26 deletions
diff --git a/modules/system/system.module b/modules/system/system.module
index d187cc4ce..7ebd8004b 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -2573,32 +2573,11 @@ function system_default_region($theme) {
return isset($regions[0]) ? $regions[0] : '';
}
-function _system_settings_form_automatic_defaults($form) {
- // Get an array of all non-property keys
- $keys = element_children($form);
-
- foreach ($keys as $key) {
- // If the property (key) '#default_value' exists, replace it.
- if (array_key_exists('#default_value', $form[$key])) {
- $form[$key]['#default_value'] = variable_get($key, $form[$key]['#default_value']);
- }
- else {
- // Recurse through child elements
- $form[$key] = _system_settings_form_automatic_defaults($form[$key]);
- }
- }
-
- return $form;
-}
-
/**
* Add default buttons to a form and set its prefix.
*
* @param $form
* An associative array containing the structure of the form.
- * @param $automatic_defaults
- * Automatically load the saved values for each field from the system variables
- * (defaults to TRUE).
*
* @return
* The form structure.
@@ -2606,14 +2585,10 @@ function _system_settings_form_automatic_defaults($form) {
* @see system_settings_form_submit()
* @ingroup forms
*/
-function system_settings_form($form, $automatic_defaults = TRUE) {
+function system_settings_form($form) {
$form['actions']['#type'] = 'actions';
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
- if ($automatic_defaults) {
- $form = _system_settings_form_automatic_defaults($form);
- }
-
if (!empty($_POST) && form_get_errors()) {
drupal_set_message(t('The settings have not been saved because of the errors.'), 'error');
}