You are here

function jstimer_init in Javascript Timer 6

Same name and namespace in other branches
  1. 7 jstimer.module \jstimer_init()

Implementation of hook_init

File

./jstimer.module, line 92
A module which creates javascript timed dhtml things.

Code

function jstimer_init() {

  //menu_router_build(TRUE); // comment after testing
  $path = variable_get('jstimer_timerjs_path', DEFAULT_TIMERJS_PATH);
  $file_download_type = variable_get('file_downloads', 1);
  if (!file_exists($path) && $file_download_type == 1) {
    jstimer_build_js_cache();
  }
  if (jstimer_load_js()) {
    if ($file_download_type == 1) {
      drupal_add_js($path, $type = 'module', $scope = 'header', $defer = FALSE, $cache = TRUE, $preprocess = FALSE);
    }
    else {
      drupal_add_js(jstimer_get_javascript(), $type = 'inline', $scope = 'header', $defer = FALSE, $cache = TRUE, $preprocess = FALSE);
    }
  }
}