You are here

function variable_realm_init in Variable 7

Same name and namespace in other branches
  1. 7.2 variable_realm/variable_realm.module \variable_realm_init()

Implements hook_init()

Let realms be overriden by query string parameters, but only for:

  • Admin paths (not variable admin pages)

File

variable_realm/variable_realm.module, line 27
Variable API module - Realms

Code

function variable_realm_init() {
  if (arg(0) == 'admin' && arg(3) != 'variable' && user_access('administer site configuration')) {
    foreach (variable_realm_params() as $realm_name => $realm_key) {
      variable_realm_switch($realm_name, $realm_key);
    }
  }
}