You are here

function google_admanager_get_variables in DFP Small Business (Google Ad Manager) 6.3

3 calls to google_admanager_get_variables()
google_admanager_gam_init in plugins/ad_providers/gam.inc
google_admanager_gpt_async_targetting in plugins/ad_providers/gpt_async.inc
google_admanager_set_variable in ./google_admanager.module

File

./google_admanager.module, line 438

Code

function google_admanager_get_variables($key = NULL, $value = NULL) {
  static $variables;
  if (!isset($variables)) {
    $variables = array();
    if ($custom_variables = variable_get('google_admanager_custom_variables', FALSE)) {
      foreach ($custom_variables as $variable) {
        if (!empty($variable['key'])) {
          if (module_exists('token')) {
            $output = token_replace_multiple($variable['value'], NULL, '[', ']', array(
              'clear' => TRUE,
            ));
          }
          else {
            $output = $variable['value'];
          }
          $variables[_google_admanager_clean_string($variable['key'])] = $output;
        }
      }
    }
  }
  if (!empty($key)) {
    $variables[_google_admanager_clean_string($key)] = $value;
  }
  return $variables;
}