You are here

function _content_lock_add_unload_js in Content locking (anti-concurrent editing) 6

Same name and namespace in other branches
  1. 6.2 content_lock.module \_content_lock_add_unload_js()
  2. 7 content_lock.module \_content_lock_add_unload_js()
  3. 7.2 content_lock.module \_content_lock_add_unload_js()
1 string reference to '_content_lock_add_unload_js'
content_lock_form_alter in ./content_lock.module
Implementation of hook_form_alter().

File

./content_lock.module, line 264
Allows users to lock documents for modification.

Code

function _content_lock_add_unload_js(&$form, $form_state) {
  $m = drupal_get_path('module', 'content_lock');
  drupal_add_js("{$m}/js/jquery.url.packed.js", 'module');
  drupal_add_js("{$m}/js/onUserExit.js", 'module');
  drupal_add_js("{$m}/js/content_lock_init.js", 'module');
  drupal_add_js(array(
    'content_lock' => array(
      'nid' => $form['#node']->nid,
    ),
  ), 'setting');
  return $form;
}