You are here

function variable_settings_form in Variable 7.2

Add default buttons to a form and set its prefix.

Parameters

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

$options: Aditional options to pass on, like variable realm.

Return value

The form structure.

See also

system_settings_form_submit()

1 call to variable_settings_form()
variable_edit_form in ./variable.module
Form for variable list

File

./variable.module, line 776
Variable API module

Code

function variable_settings_form($form, $options = array()) {
  $form['#variable_options'] = $options;
  $form['actions']['#type'] = 'actions';
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  if (!empty($_POST) && form_get_errors()) {
    drupal_set_message(t('The settings have not been saved because of the errors.'), 'error');
  }
  $form['#submit'][] = 'variable_settings_form_submit';

  // By default, render the form using theme_system_settings_form().
  if (!isset($form['#theme'])) {
    $form['#theme'] = 'system_settings_form';
  }
  return $form;
}