You are here

function getdirections_init in Get Directions 7.3

Same name and namespace in other branches
  1. 6.2 getdirections.module \getdirections_init()
  2. 6 getdirections.module \getdirections_init()
  3. 7.2 getdirections.module \getdirections_init()

Implements hook_init().

File

./getdirections.module, line 24
Fetches google map directions.

Code

function getdirections_init() {
  if (!module_load_include('inc', 'getdirections', 'getdirections.config')) {
    define('GETDIRECTIONS_WAYPOINTS_MAX', 8);
  }
  module_load_include('inc', 'getdirections', 'getdirections.api');
  if (module_exists('colorbox')) {
    $getdirections_colorbox = variable_get('getdirections_colorbox', array(
      'enable' => 0,
      'width' => 600,
      'height' => 600,
    ));
    $settings = array(
      'getdirections_colorbox' => $getdirections_colorbox,
    );
    drupal_add_js($settings, 'setting');
    drupal_add_js(GETDIRECTIONS_PATH . '/js/getdirections.js');
  }
}