You are here

function _variable_realm_variable_settings_form_list in Variable 7.2

Same name and namespace in other branches
  1. 7 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.

2 calls to _variable_realm_variable_settings_form_list()
variable_realm_form_system_theme_settings_alter in variable_realm/variable_realm.module
Implements hook_form_FORM_ID_alter()
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 357
Administrative forms for variable realms.

Code

function _variable_realm_variable_settings_form_list() {
  $list = array();
  foreach (variable_realm_list_all() as $realm_name => $controller) {
    if ($controller
      ->getInfo('form settings') && ($realm_list = $controller
      ->getEnabledVariables())) {

      // 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;
}