You are here

function _variable_realm_variable_settings_form_list in Variable 7

Same name and namespace in other branches
  1. 7.2 variable_realm/variable_realm.form.inc \_variable_realm_variable_settings_form_list()

Get variable list for settings forms handling multiple realms.

Variables available for more than one realm, will be kept only in the list for the realm with the higher weight.

1 call to _variable_realm_variable_settings_form_list()
variable_realm_variable_settings_form_alter in variable_realm/variable_realm.variable.inc
Implements hook_variable_settings_form_alter().

File

variable_realm/variable_realm.form.inc, line 283
Administrative forms for variable realms.

Code

function _variable_realm_variable_settings_form_list() {
  $list = array();
  foreach (array_keys(variable_realm_list()) as $realm_name) {
    $realm_info = variable_realm_info($realm_name);
    if (!empty($realm_info['form settings']) && ($realm_list = variable_realm_get_variable_list($realm_name))) {

      // Remove from previous realms with lower weight.
      foreach ($list as $name => $variables) {
        $list[$name] = array_diff($variables, $realm_list);
      }
      $list[$realm_name] = $realm_list;
    }
  }
  return $list;
}