CSS_THEME, )); } /** * Includes the given javascript files from this module. * * @param type $files */ public static function addJS($files = array()) { self::addFiles('drupal_add_js', PATH_XML_FORM_ELEMENTS_JS, $files); } /** * Includes the given css files from this module. * * @param type $files */ public static function addCSS($files = array()) { self::addFiles('drupal_add_css', PATH_XML_FORM_ELEMENTS_CSS, $files, array( 'group' => CSS_THEME, )); } /** * Adds files using the given $method, $path and $files. * * @param string $function * The function to call to add the given files. * @param string $path * The path where the files are located. * @param array $files * The file(s) to be added. */ private static function addFiles($function, $path, $files = array(), $additional_argument = NULL) { // Convert string to array. $files = (array)$files; foreach ($files as $file) { $function($path . $file, $additional_argument); } } }