You are here

function variable_realm_variable_settings_form_alter in Variable 7.2

Same name and namespace in other branches
  1. 7 variable_realm/variable_realm.variable.inc \variable_realm_variable_settings_form_alter()

Implements hook_variable_settings_form_alter().

File

variable_realm/variable_realm.variable.inc, line 49
Variable hooks.

Code

function variable_realm_variable_settings_form_alter(&$form, &$form_state, $form_id) {
  form_load_include($form_state, 'form.inc', 'variable_realm');
  foreach (_variable_realm_variable_settings_form_list() as $realm_name => $variables) {
    if ($realm_variables = _variable_realm_variable_settings_form_alter($form, $realm_name, variable_children($variables))) {
      $form['#realm_variables'][$realm_name] = $realm_variables;
    }
  }
  if (!empty($form['#realm_variables'])) {
    array_unshift($form['#submit'], 'variable_realm_variable_settings_form_submit');

    // Add form switcher and current key for each realm.
    _variable_realm_variable_settings_form_switcher($form);
  }
}