You are here

function variable_realm_status in Variable 7

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

Set / get current realm values.

Parameters

$realm: Optional realm name

$key: Optional realm value to set a status for this realm. FALSE to disable this realm.

4 calls to variable_realm_status()
variable_realm_boot in variable_realm/variable_realm.module
Implements hook_boot()
variable_realm_form_key_current in variable_realm/variable_realm.form.inc
Get current realm key from query string.
variable_realm_rebuild in variable_realm/variable_realm.module
Rebuild current variable realm
variable_realm_switch in variable_realm/variable_realm.module
Switch current variable realms.
2 string references to 'variable_realm_status'
variable_realm_current in variable_realm/variable_realm.module
Get current realm values ordered by weights.
variable_realm_reset in variable_realm/variable_realm.module
Reset realms, deleting currently set ones

File

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

Code

function variable_realm_status($realm = NULL, $key = NULL) {
  $status =& drupal_static(__FUNCTION__, array());
  if ($realm && isset($key)) {

    // Make sure the realm is created.
    variable_realm($realm, $key);

    // Set current realm key.
    $status[$realm] = $key;
  }
  if ($realm) {
    return isset($status[$realm]) ? $status[$realm] : NULL;
  }
  else {
    return $status;
  }
}