You are here

function ip_geoloc_js_info in IP Geolocation Views & Maps 7

Same name and namespace in other branches
  1. 8 ip_geoloc.module \ip_geoloc_js_info()

Implements hook_js_info().

File

./ip_geoloc.module, line 216
IPGV&M is a mapping engine for Views that contain locations of entities and/or visitors. Google Maps, Leaflet and OpenLayers2 maps are all supported. and available through this module. Using a number of optional sources IPGV&M also retrieves…

Code

function ip_geoloc_js_info() {

  // With the js.module installed, and the .htaccess file edited to route
  // through js.php, this array defines what function to call when a POST is
  // received on "js/ip_geoloc/current_location".
  // We're calling the same function as defined in ip_geoloc_menu(), but using
  // a faster, more economic bootstrap phase, without hook_init().
  $dependencies = module_exists('session_cache_file') ? array(
    'session_cache',
    'session_cache_file',
  ) : (module_exists('session_cache') ? array(
    'session_cache',
  ) : array());
  $js_info = array(
    'current_location' => array(
      'bootstrap' => module_exists('better_statistics') ? DRUPAL_BOOTSTRAP_FULL : DRUPAL_BOOTSTRAP_SESSION,
      'callback function' => 'ip_geoloc_current_location_ajax_recipient',
      'dependencies' => $dependencies,
      'skip init' => TRUE,
      'token' => FALSE,
    ),
  );
  return $js_info;
}