Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.794 diff -u -r1.794 common.inc --- includes/common.inc 16 Sep 2008 17:50:01 -0000 1.794 +++ includes/common.inc 17 Sep 2008 06:39:11 -0000 @@ -1658,44 +1658,50 @@ * file added to the list, if exists in the same directory. This CSS file * should contain overrides for properties which should be reversed or * otherwise different in a right-to-left display. - * @param $type - * (optional) The type of stylesheet that is being added. Types are: module - * or theme. - * @param $media - * (optional) The media type for the stylesheet, e.g., all, print, screen. - * @param $preprocess - * (optional) Should this CSS file be aggregated and compressed if this - * feature has been turned on under the performance section? - * - * What does this actually mean? - * CSS preprocessing is the process of aggregating a bunch of separate CSS - * files into one file that is then compressed by removing all extraneous - * white space. - * - * The reason for merging the CSS files is outlined quite thoroughly here: - * http://www.die.net/musings/page_load_time/ - * "Load fewer external objects. Due to request overhead, one bigger file - * just loads faster than two smaller ones half its size." - * - * However, you should *not* preprocess every file as this can lead to - * redundant caches. You should set $preprocess = FALSE when: - * - * - Your styles are only used rarely on the site. This could be a special - * admin page, the homepage, or a handful of pages that does not represent - * the majority of the pages on your site. + * @param $options + * An optional associative array of additional options, with the following + * keys: + * - 'type' + * The type of stylesheet that is being added. Types are: module or + * theme. + * - 'media' + * The media type for the stylesheet, e.g., all, print, screen. + * - 'preprocess': + * Should this CSS file be aggregated and compressed if this feature has + * been turned on under the performance section? + * + * What does this actually mean? + * CSS preprocessing is the process of aggregating a bunch of separate CSS + * files into one file that is then compressed by removing all extraneous + * white space. + * + * The reason for merging the CSS files is outlined quite thoroughly here: + * http://www.die.net/musings/page_load_time/ + * "Load fewer external objects. Due to request overhead, one bigger file + * just loads faster than two smaller ones half its size." + * + * However, you should *not* preprocess every file as this can lead to + * redundant caches. You should set $preprocess = FALSE when your styles + * are only used rarely on the site. This could be a special admin page, + * the homepage, or a handful of pages that does not represent the + * majority of the pages on your site. * - * Typical candidates for caching are for example styles for nodes across - * the site, or used in the theme. + * Typical candidates for caching are for example styles for nodes across + * the site, or used in the theme. * @return * An array of CSS files. */ -function drupal_add_css($path = NULL, $type = 'module', $media = 'all', $preprocess = TRUE) { +function drupal_add_css($path = NULL, $options = array()) { static $css = array(); global $language; // Create an array of CSS files for each media type first, since each type needs to be served // to the browser differently. if (isset($path)) { + $media = isset($options['media']) ? $options['media'] : 'all'; + $type = isset($options['type']) ? $options['type'] : 'module'; + $preprocess = isset($options['preprocess']) ? $options['preprocess'] : TRUE; + // This check is necessary to ensure proper cascading of styles and is faster than an asort(). if (!isset($css[$media])) { $css[$media] = array('module' => array(), 'theme' => array()); Index: includes/locale.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/locale.inc,v retrieving revision 1.182 diff -u -r1.182 locale.inc --- includes/locale.inc 15 Sep 2008 20:48:07 -0000 1.182 +++ includes/locale.inc 17 Sep 2008 06:39:11 -0000 @@ -2209,7 +2209,7 @@ */ function _locale_translate_language_list($translation, $limit_language) { // Add CSS - drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css', 'module', 'all', FALSE); + drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css', array('preprocess' => FALSE)); $languages = language_list(); unset($languages['en']); Index: includes/theme.maintenance.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.maintenance.inc,v retrieving revision 1.16 diff -u -r1.16 theme.maintenance.inc --- includes/theme.maintenance.inc 21 Aug 2008 19:36:36 -0000 1.16 +++ includes/theme.maintenance.inc 17 Sep 2008 06:39:11 -0000 @@ -62,10 +62,10 @@ // These are usually added from system_init() -except maintenance.css. // When the database is inactive it's not called so we add it here. - drupal_add_css(drupal_get_path('module', 'system') . '/defaults.css', 'module'); - drupal_add_css(drupal_get_path('module', 'system') . '/system.css', 'module'); - drupal_add_css(drupal_get_path('module', 'system') . '/system-menus.css', 'module'); - drupal_add_css(drupal_get_path('module', 'system') . '/maintenance.css', 'module'); + drupal_add_css(drupal_get_path('module', 'system') . '/defaults.css'); + drupal_add_css(drupal_get_path('module', 'system') . '/system.css'); + drupal_add_css(drupal_get_path('module', 'system') . '/system-menus.css'); + drupal_add_css(drupal_get_path('module', 'system') . '/maintenance.css'); } /** Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.435 diff -u -r1.435 theme.inc --- includes/theme.inc 15 Sep 2008 20:48:07 -0000 1.435 +++ includes/theme.inc 17 Sep 2008 06:39:11 -0000 @@ -133,7 +133,7 @@ // And now add the stylesheets properly foreach ($final_stylesheets as $media => $stylesheets) { foreach ($stylesheets as $stylesheet) { - drupal_add_css($stylesheet, 'theme', $media); + drupal_add_css($stylesheet, array('type' => 'theme', 'media' => $media)); } } Index: modules/simpletest/simpletest.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.module,v retrieving revision 1.12 diff -u -r1.12 simpletest.module --- modules/simpletest/simpletest.module 10 Sep 2008 04:13:01 -0000 1.12 +++ modules/simpletest/simpletest.module 17 Sep 2008 06:39:11 -0000 @@ -202,8 +202,8 @@ * @ingroup themeable */ function theme_simpletest_test_form($form) { - drupal_add_css(drupal_get_path('module', 'simpletest') .'/simpletest.css', 'module'); - drupal_add_js(drupal_get_path('module', 'simpletest') .'/simpletest.js', 'module'); + drupal_add_css(drupal_get_path('module', 'simpletest') .'/simpletest.css'); + drupal_add_js(drupal_get_path('module', 'simpletest') .'/simpletest.js'); $header = array( array('data' => t('Run'), 'class' => 'simpletest_run checkbox'), array('data' => t('Test'), 'class' => 'simpletest_test'), Index: modules/openid/openid.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/openid/openid.pages.inc,v retrieving revision 1.6 diff -u -r1.6 openid.pages.inc --- modules/openid/openid.pages.inc 14 Apr 2008 17:48:38 -0000 1.6 +++ modules/openid/openid.pages.inc 17 Sep 2008 06:39:11 -0000 @@ -29,7 +29,7 @@ */ function openid_user_identities($account) { drupal_set_title(check_plain($account->name)); - drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css', 'module'); + drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css'); // Check to see if we got a response $result = openid_complete(); Index: modules/openid/openid.module =================================================================== RCS file: /cvs/drupal/drupal/modules/openid/openid.module,v retrieving revision 1.28 diff -u -r1.28 openid.module --- modules/openid/openid.module 6 Sep 2008 08:36:20 -0000 1.28 +++ modules/openid/openid.module 17 Sep 2008 06:39:11 -0000 @@ -75,7 +75,7 @@ */ function openid_form_alter(&$form, $form_state, $form_id) { if ($form_id == 'user_login_block' || $form_id == 'user_login') { - drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css', 'module'); + drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css'); drupal_add_js(drupal_get_path('module', 'openid') . '/openid.js'); if (!empty($form_state['post']['openid_identifier'])) { $form['name']['#required'] = FALSE; Index: modules/help/help.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/help/help.admin.inc,v retrieving revision 1.6 diff -u -r1.6 help.admin.inc --- modules/help/help.admin.inc 14 Apr 2008 17:48:37 -0000 1.6 +++ modules/help/help.admin.inc 17 Sep 2008 06:39:11 -0000 @@ -11,7 +11,7 @@ */ function help_main() { // Add CSS - drupal_add_css(drupal_get_path('module', 'help') . '/help.css', 'module', 'all', FALSE); + drupal_add_css(drupal_get_path('module', 'help') . '/help.css', array('preprocess' => FALSE)); $output = '
' . t('Help is available on the following items:') . '
' . help_links_as_list(); return $output; } Index: modules/dblog/dblog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/dblog/dblog.module,v retrieving revision 1.27 diff -u -r1.27 dblog.module --- modules/dblog/dblog.module 21 Aug 2008 19:36:37 -0000 1.27 +++ modules/dblog/dblog.module 17 Sep 2008 06:39:11 -0000 @@ -83,7 +83,7 @@ function dblog_init() { if (arg(0) == 'admin' && arg(1) == 'reports') { // Add the CSS for this module - drupal_add_css(drupal_get_path('module', 'dblog') . '/dblog.css', 'module', 'all', FALSE); + drupal_add_css(drupal_get_path('module', 'dblog') . '/dblog.css', array('preprocess' => FALSE)); } } Index: modules/search/search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.module,v retrieving revision 1.264 diff -u -r1.264 search.module --- modules/search/search.module 6 Sep 2008 08:36:20 -0000 1.264 +++ modules/search/search.module 17 Sep 2008 06:39:11 -0000 @@ -1021,7 +1021,7 @@ function search_form(&$form_state, $action = '', $keys = '', $type = NULL, $prompt = NULL) { // Add CSS - drupal_add_css(drupal_get_path('module', 'search') . '/search.css', 'module', 'all', FALSE); + drupal_add_css(drupal_get_path('module', 'search') . '/search.css', array('preprocess' => FALSE)); if (!$action) { $action = url('search/' . $type); Index: modules/tracker/tracker.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/tracker/tracker.pages.inc,v retrieving revision 1.7 diff -u -r1.7 tracker.pages.inc --- modules/tracker/tracker.pages.inc 6 Sep 2008 08:36:21 -0000 1.7 +++ modules/tracker/tracker.pages.inc 17 Sep 2008 06:39:11 -0000 @@ -12,7 +12,7 @@ */ function tracker_page($account = NULL, $set_title = FALSE) { // Add CSS - drupal_add_css(drupal_get_path('module', 'tracker') . '/tracker.css', 'module', 'all', FALSE); + drupal_add_css(drupal_get_path('module', 'tracker') . '/tracker.css', array('preprocess' => FALSE)); if ($account) { if ($set_title) { Index: modules/color/color.module =================================================================== RCS file: /cvs/drupal/drupal/modules/color/color.module,v retrieving revision 1.45 diff -u -r1.45 color.module --- modules/color/color.module 15 Sep 2008 21:06:07 -0000 1.45 +++ modules/color/color.module 17 Sep 2008 06:39:11 -0000 @@ -153,11 +153,11 @@ $info = color_get_info($theme); // Add Farbtastic color picker. - drupal_add_css('misc/farbtastic/farbtastic.css', 'module', 'all', FALSE); + drupal_add_css('misc/farbtastic/farbtastic.css', array('preprocess' => FALSE)); drupal_add_js('misc/farbtastic/farbtastic.js'); // Add custom CSS and JS. - drupal_add_css($base . '/color.css', 'module', 'all', FALSE); + drupal_add_css($base . '/color.css', array('preprocess' => FALSE)); drupal_add_js($base . '/color.js'); drupal_add_js(array('color' => array( 'reference' => color_get_palette($theme, true) Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.620 diff -u -r1.620 system.module --- modules/system/system.module 16 Sep 2008 18:08:59 -0000 1.620 +++ modules/system/system.module 17 Sep 2008 06:39:11 -0000 @@ -685,13 +685,13 @@ if (arg(0) == 'admin' || (variable_get('node_admin_theme', '0') && arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit'))) { global $custom_theme; $custom_theme = variable_get('admin_theme', '0'); - drupal_add_css(drupal_get_path('module', 'system') . '/admin.css', 'module'); + drupal_add_css(drupal_get_path('module', 'system') . '/admin.css'); } // Add the CSS for this module. - drupal_add_css(drupal_get_path('module', 'system') . '/defaults.css', 'module'); - drupal_add_css(drupal_get_path('module', 'system') . '/system.css', 'module'); - drupal_add_css(drupal_get_path('module', 'system') . '/system-menus.css', 'module'); + drupal_add_css(drupal_get_path('module', 'system') . '/defaults.css'); + drupal_add_css(drupal_get_path('module', 'system') . '/system.css'); + drupal_add_css(drupal_get_path('module', 'system') . '/system-menus.css'); } /** Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.921 diff -u -r1.921 user.module --- modules/user/user.module 15 Sep 2008 15:18:59 -0000 1.921 +++ modules/user/user.module 17 Sep 2008 06:39:11 -0000 @@ -1091,7 +1091,7 @@ } function user_init() { - drupal_add_css(drupal_get_path('module', 'user') . '/user.css', 'module'); + drupal_add_css(drupal_get_path('module', 'user') . '/user.css'); } function user_uid_optional_load($arg) { Index: modules/block/block.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.admin.inc,v retrieving revision 1.19 diff -u -r1.19 block.admin.inc --- modules/block/block.admin.inc 16 Jul 2008 21:59:25 -0000 1.19 +++ modules/block/block.admin.inc 17 Sep 2008 06:39:11 -0000 @@ -28,7 +28,7 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) { global $theme_key, $custom_theme; - drupal_add_css(drupal_get_path('module', 'block') . '/block.css', 'module', 'all', FALSE); + drupal_add_css(drupal_get_path('module', 'block') . '/block.css', array('preprocess' => FALSE)); // If non-default theme configuration has been selected, set the custom theme. $custom_theme = isset($theme) ? $theme : variable_get('theme_default', 'garland');