You are here

function _oa_core_bootstrap_library_javascript_alter in Open Atrium Core 7.2

Helper function to rewrite the bootstrap_library Javascript.

Adds a group and weight to put the Bootstrap Javascript after jQuery but before jQuery UI.

1 call to _oa_core_bootstrap_library_javascript_alter()
oa_core_libraries_info_alter in ./oa_core.module
Implements hook_libraries_info_alter().

File

./oa_core.module, line 2365

Code

function _oa_core_bootstrap_library_javascript_alter(&$js, $weight) {
  foreach ($js as $js_file => $options) {

    // Handle the case where a single file name was used, rather than giving
    // the file as the key and the options as the value.
    if (!is_array($options)) {
      unset($js[$js_file]);
      $js_file = $options;
      $options = array();
    }

    // Make our changes and overwrite.
    $options['group'] = JS_LIBRARY;
    $options['weight'] = $weight;
    $js[$js_file] = $options;
  }
}