You are here

function fieldset_helper_add_js in Fieldset helper 6

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

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

File

./fieldset_helper.module, line 135
Saves the collapsed state of a Drupal collapsible fieldset.

Code

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;
}