Same name and namespace in other branches
  1. 4.6.x modules/system.module \system_settings_form()
  2. 4.7.x modules/system.module \system_settings_form()
  3. 5.x modules/system/system.module \system_settings_form()
  4. 7.x modules/system/system.module \system_settings_form()

Add default buttons to a form and set its prefix.

Parameters

$form: An associative array containing the structure of the form.

Return value

The form structure.

See also

system_settings_form_submit()

Related topics

27 calls to system_settings_form()
aggregator_admin_settings in modules/aggregator/aggregator.admin.inc
Form builder; Configure the aggregator system.
blogapi_admin_settings in modules/blogapi/blogapi.module
book_admin_settings in modules/book/book.admin.inc
Builds and returns the book settings form.
contact_admin_settings in modules/contact/contact.admin.inc
dblog_admin_settings in modules/dblog/dblog.admin.inc
dblog module settings form.

... See full list

File

modules/system/system.module, line 1107
Configuration system that lets administrators modify the workings of the site.

Code

function system_settings_form($form) {
  $form['buttons']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  $form['buttons']['reset'] = array(
    '#type' => 'submit',
    '#value' => t('Reset to defaults'),
  );
  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';
  $form['#theme'] = 'system_settings_form';
  return $form;
}