You are here

function datex_webfrm_js_alter in Datex 7.3

Implements hook_js_alter().

ensure datex_webfrm is added BEFORE webform.

File

datex_webfrm/datex_webfrm.module, line 8

Code

function datex_webfrm_js_alter(&$js) {
  if (!module_exists('datex_popup')) {
    return;
  }
  $datex_module_path = drupal_get_path('module', 'datex_webfrm');
  drupal_add_js($datex_module_path . '/datex_webfrm.js');

  // This function is called and there is a second pass. In the second pass
  // out library will be there. We'll bring it to the beginning.
  foreach (array_keys($js) as $each) {
    if (strpos($each, 'datex_webfrm') !== FALSE) {
      $u = $js[$each];
      unset($js[$each]);
      array_unshift($js, $u);
    }
  }
}