You are here

function _google_tag_variable_info in GoogleTagManager 7.2

Same name and namespace in other branches
  1. 7 includes/variable.inc \_google_tag_variable_info()

Implements hook_variable_info().

1 call to _google_tag_variable_info()
google_tag_variable_info in ./google_tag.module
Implements hook_variable_info().

File

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

Code

function _google_tag_variable_info($options) {

  // Gather data.
  $groups = array(
    'general',
    'advanced',
    'path',
    'role',
    'status',
    'settings',
    'internal',
  );
  $common = array(
    'group' => 'google_tag',
    'localize' => TRUE,
    'multidomain' => TRUE,
  );

  // Build variables.
  $variables = array();
  foreach ($groups as $group) {
    $function = "_google_tag_variable_info_{$group}";
    $variables += $function($options);
  }
  foreach ($variables as $key => $variable) {
    $variables[$key] += $common;
  }
  if (!empty($options['use_prefix'])) {

    // Deal with schema 7200 version change.
    $retro = array();
    foreach ($variables as $key => $variable) {
      $retro["google_tag_{$key}"] = $variable;
    }
    $variables = $retro;
  }
  return $variables;
}