You are here

function hotjar_get_settings in Hotjar 7

Same name and namespace in other branches
  1. 8 hotjar.module \hotjar_get_settings()
  2. 6 hotjar.module \hotjar_get_settings()

Get Hotjar settings.

5 calls to hotjar_get_settings()
hotjar_admin_settings_form in ./hotjar.admin.inc
Hotjar settings form.
hotjar_page_build in ./hotjar.module
Implements hook_page_build().
_hotjar_access in ./hotjar.module
Determines whether we add tracking code to page.
_hotjar_check_roles in ./hotjar.module
Check user role.
_hotjar_should_be_added in ./hotjar.module
Check Hotjar code should be added.

File

./hotjar.module, line 62
Drupal Module: Hotjar.

Code

function hotjar_get_settings() {
  $settings = variable_get('hotjar_settings', array());
  $settings += array(
    'hotjar_account' => NULL,
    'hotjar_visibility_pages' => 0,
    'hotjar_pages' => HOTJAR_PAGES,
    'hotjar_visibility_roles' => 0,
    'hotjar_roles' => array(),
    'hotjar_snippet_version' => 6,
  );
  if (empty($settings['hotjar_snippet_version'])) {
    $settings['hotjar_snippet_version'] = 6;
  }
  foreach ($settings as $name => $value) {
    if (array_key_exists($name, $GLOBALS['conf'])) {
      $settings[$name] = $GLOBALS['conf'][$name];
    }
  }
  return $settings;
}