_fieldset_helper_add_js

contrib-jrockowitz/fieldset_helper/fieldset_helper.module, line 140

Versions
6
_fieldset_helper_add_js()

Adds 'fieldset_helper.js' and related settings to a page only once.

▾ 2 functions call _fieldset_helper_add_js()

fieldset_helper_alter_theme_fieldset in contrib-jrockowitz/fieldset_helper/fieldset_helper.module
Theme related function that is used by the phptemplate_fieldset() function (in fieldset_helper.theme.inc) used to alter the fieldset so that its collapsible state can be saved.
fieldset_helper_form_alter in contrib-jrockowitz/fieldset_helper/fieldset_helper.module
Implementation of hook_form_alter().

Code

<?php
function _fieldset_helper_add_js() {
  static $js_loaded;

  // Check if js has already been loaded.
  if (isset($js_loaded)) {
    return;
  }

  // Add js file
  drupal_add_js('misc/collapse.js');
  drupal_add_js( drupal_get_path('module', 'fieldset_helper') .'/fieldset_helper.js');

  $js_loaded = TRUE;
}
?>