=== modified file 'yui.module' --- yui.module 2009-02-27 15:49:40 +0000 +++ yui.module 2009-02-27 19:28:30 +0000 @@ -87,16 +88,26 @@ * Location of the YUI library. * @param $file_and_path * File to include. + * @param $returl + * Return only the URL to the file that should be included */ -function yui_add_js($component = NULL, $yui_source = NULL, $file_and_path = NULL) { +function yui_add_js($component = NULL, $yui_source = NULL, $file_and_path = NULL, $returl = false) { static $js_files = array(); if (! preg_match('/^http:\/\//', $yui_source)) { - drupal_add_js($yui_source . $file_and_path); + if ($returl) { + return url($yui_source . $file_and_path); + } else { + drupal_add_js($yui_source . $file_and_path); + } } elseif (! in_array($yui_source . $file_and_path, $js_files)) { - drupal_set_html_head(''); - $js_files[] = $yui_source . $file_and_path; + if ($returl) { + return $yui_source.$file_and_path; + } else { + drupal_set_html_head(''); + $js_files[] = $yui_source . $file_and_path; + } } } @@ -110,14 +121,22 @@ * @param $file_and_path * File to include. */ -function yui_add_css($component = NULL, $yui_source = NULL, $file_and_path = NULL) { +function yui_add_css($component = NULL, $yui_source = NULL, $file_and_path = NULL, $returl = false) { static $css_files = array(); if (! preg_match('/^http:\/\//', $yui_source)) { - drupal_add_css($yui_source . $file_and_path); + if ($returl) { + return url($yui_source . $file_and_path); + } else { + drupal_add_css($yui_source . $file_and_path); + } } elseif (! in_array($yui_source . $file_and_path, $css_files)) { - drupal_set_html_head(''); - $css_files[] = $yui_source . $file_and_path; + if ($returl) { + return $yui_source.$file_and_path; + } else { + drupal_set_html_head(''); + $css_files[] = $yui_source . $file_and_path; + } } -} \ No newline at end of file +}