You are here

function eloqua_init in Eloqua 6

Same name and namespace in other branches
  1. 7 eloqua.module \eloqua_init()

Implementation of hook_init().

File

./eloqua.module, line 25

Code

function eloqua_init() {
  $directory = variable_get(ELOQUA_VARIABLE_SCRIPTS_DIRECTORY, ELOQUA_VARIABLE_SCRIPTS_DIRECTORY_DEFAULT);

  // Throw an error if either of our 2 primary js files do not exist.
  foreach (array(
    'elqCfg',
    'elqImg',
  ) as $file) {
    if (!file_exists($directory . '/' . $file . '.js')) {
      drupal_set_message(t('You must place the !file.js file in !directory for the eloqua module to function.', array(
        '!file' => $file,
        '!directory' => $directory,
      )), 'error');
    }
    else {
      drupal_add_js($directory . '/' . $file . '.js');
    }
  }
}