array( 'cleanurls' => (bool) variable_get('clean_url', '0'), 'basePath' => base_path(), ), ), 'setting'); $core_sent = TRUE; } if (is_array($files)) { foreach ($files as $file) { drupal_add_js($file); } } else { drupal_add_js($files); } } /** * Load an include file for the current theme. * * To avoid having to prematurely initialize the theme, call * this function from a hook_footer() implementation. hook_footer() * typically is called after the theme has been initiated, but * before the header has been generated. */ function jstools_theme_include($module) { global $theme; $current_theme = $theme ? $theme : variable_get('theme_default', 'garland'); $file = drupal_get_path('module', $module) .'/theme/'. $current_theme .'.inc'; if (file_exists($file)) { include_once $file; return TRUE; } return FALSE; } /** * Load theme-specific data. * * Allows loading e.g. of theme-specific jQuery selectors. * To avoid having to prematurely initialize the theme, call * this function from a hook_footer() implementation. hook_footer() * typically is called after the theme has been initiated, but * before the header has been generated. */ function jstools_theme_data($module) { return jstools_theme_include($module) ? module_invoke($module, 'theme_data') : array(); } /** * Load available types by module. */ function jstools_modules_includes($module) { $path = drupal_get_path('module', $module) .'/modules'; $files = file_scan_directory($path, '\.inc$'); foreach ($files as $file) { if (module_exists($file->name)) { include_once $file->filename; } } }