You are here

function _google_tag_variable_info_realm in GoogleTagManager 7.2

Implements hook_variable_info().

File

includes/variable.inc, line 162
Contains the variable definitions.

Code

function _google_tag_variable_info_realm($options) {

  // @todo Does google_tag_condition_filter() obviate this gate check?
  if (!module_exists('variable_realm') || !module_exists('variable_store')) {
    return array();
  }
  $options = array();
  $realms = variable_realm_list();
  foreach ($realms as $realm_name => $realm_title) {
    $keys = variable_realm_keys($realm_name);
    foreach ($keys as $key_name => $key_title) {
      $options["{$realm_name}:{$key_name}"] = "{$realm_name}:{$key_name}";
    }
  }
  $toggle = 'realm_toggle';
  $list = 'realm_list';
  $plural = 'keys';
  $config = compact(array(
    'toggle',
    'list',
    'plural',
    'options',
  ));
  return _google_tag_variable_info_generic($config, $options);
}