system_settings_form
- Versions
- 4.6
system_settings_form($form)- 4.7
system_settings_form($form_id, $form)- 5 – 6
system_settings_form($form)- 7
system_settings_form($form, $automatic_defaults = TRUE)
Add default buttons to a form and set its prefix.
See also
Parameters
$form An associative array containing the structure of the form.
$automatic_defaults Automatically load the saved values for each field from the system variables (defaults to TRUE).
Return value
The form structure.
Code
modules/system/system.module, line 2432
<?php
function system_settings_form($form, $automatic_defaults = TRUE) {
$form['buttons']['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');
}
$form['#submit'][] = 'system_settings_form_submit';
// By default, render the form using theme_system_settings_form().
if (!isset($form['#theme'])) {
$form['#theme'] = 'system_settings_form';
}
return $form;
}
?>Login or register to post comments 