? sites/all/modules Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.611.2.1 diff -u -r1.611.2.1 common.inc --- includes/common.inc 14 Feb 2007 04:15:24 -0000 1.611.2.1 +++ includes/common.inc 7 Mar 2007 02:31:26 -0000 @@ -1416,10 +1416,12 @@ * * Typical candidates for caching are for example styles for nodes across * the site, or used in the theme. + * @param $remove + * (optional) Should this CSS file be removed from the stylesheet queue? * @return * An array of CSS files. */ -function drupal_add_css($path = NULL, $type = 'module', $media = 'all', $preprocess = TRUE) { +function drupal_add_css($path = NULL, $type = 'module', $media = 'all', $preprocess = TRUE, $remove = NULL) { static $css = array(); // Create an array of CSS files for each media type first, since each type needs to be served @@ -1429,13 +1431,32 @@ if (!isset($css[$media])) { $css[$media] = array('module' => array(), 'theme' => array()); } - $css[$media][$type][$path] = $preprocess; + if (!isset($remove)) { + $css[$media][$type][$path] = $preprocess; + } + else if (isset($css[$media][$type][$path])) { + unset($css[$media][$type][$path]); + } } return $css; } /** + * Removes a CSS file from the stylesheet queue. + * + * @param $path + * (optional) The path to the CSS file relative to the base_path(), e.g., + * /modules/devel/devel.css. + * @return + * An array of CSS files. + */ +function drupal_remove_css($path = NULL) { + $css = drupal_add_css($path, 'module', 'all', TRUE, TRUE); + return $css; +} + +/** * Returns a themed representation of all stylesheets that should be attached to the page. * It loads the CSS in order, with 'core' CSS first, then 'module' CSS, then 'theme' CSS files. * This ensures proper cascading of styles for easy overriding in modules and themes.