function ctools_add_js
Include js files as necessary.
This helper function is used by ctools but can also be used in other modules in the same way as explained in the comments of ctools_include.
Parameters
$file: The base file name to be included.
$module: Optional module containing the include.
$dir: Optional subdirectory containing the include file.
15 calls to ctools_add_js()
- ctools_ajax_command_attr in includes/
ajax.inc - Set a single property to a value, on all matched elements.
- ctools_ajax_command_redirect in includes/
ajax.inc - Force a client-side redirect.
- ctools_ajax_command_reload in includes/
ajax.inc - Force a reload of the current page.
- ctools_ajax_command_submit in includes/
ajax.inc - Submit a form.
- ctools_ajax_sample_login_success in ctools_ajax_sample/
ctools_ajax_sample.module - Post-login processor: should we go to the user account or stay in place?
File
-
./
ctools.module, line 244
Code
function ctools_add_js($file, $module = 'ctools', $dir = 'js') {
drupal_add_js(drupal_get_path('module', $module) . "/{$dir}/{$file}.js");
}