You are here

function boxes_add_js in Boxes 7

Same name and namespace in other branches
  1. 6 boxes.module \boxes_add_js()

Add JavaScript to the page.

2 calls to boxes_add_js()
boxes_block_view in ./boxes.module
Implements hook_block_view().
boxes_context_block_info_alter in ./boxes.module
Implements hook_context_block_info_alter().

File

./boxes.module, line 799
Core functionality for boxes module.

Code

function boxes_add_js() {
  static $added = FALSE;
  if ($added || !boxes_access_admin() && !boxes_access_edit()) {
    return;
  }
  $added = TRUE;
  drupal_add_library('system', 'jquery.form', TRUE);
  drupal_add_library('system', 'drupal.form', TRUE);
  drupal_add_library('system', 'drupal.progress', TRUE);
  drupal_add_library('system', 'drupal.ajax', TRUE);
  drupal_add_library('system', 'ui.dialog');
  drupal_add_js(drupal_get_path('module', 'boxes') . '/boxes.js');
  drupal_add_css(drupal_get_path('module', 'boxes') . '/boxes.css');
  drupal_add_js(array(
    'getQ' => drupal_is_front_page() ? '' : $_GET['q'],
  ), array(
    'type' => 'setting',
    'scope' => JS_DEFAULT,
  ));
}