You are here

function _variable_realm_weight in Variable 7

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

Get default weight for realm.

Realm weight is defined in hook_variable_realm_controller() and can be overridden by a variable named 'variable_realm_weight_[realm_name]'.

2 calls to _variable_realm_weight()
_variable_realm_controller in variable_realm/variable_realm.module
Create realm controller object.
_variable_realm_sort in variable_realm/variable_realm.module
Order realm names by weight.

File

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

Code

function _variable_realm_weight($realm_name) {
  $info = variable_realm_controller($realm_name);
  $weight = $info && isset($info['weight']) ? $info['weight'] : 0;
  return variable_get('variable_realm_weight_' . $realm_name, $weight);
}