Only in /Users/alex/Desktop/drupal_mod: .DS_Store diff -urp /Users/alex/Desktop/drupal/includes/common.inc /Users/alex/Desktop/drupal_mod/includes/common.inc --- /Users/alex/Desktop/drupal/includes/common.inc 2009-09-27 07:08:45.000000000 -0400 +++ /Users/alex/Desktop/drupal_mod/includes/common.inc 2009-09-28 13:29:39.000000000 -0400 @@ -2656,7 +2656,7 @@ function drupal_add_css($data = NULL, $o * (optional) An array of CSS files. If no array is provided, the default * stylesheets array is used instead. * @return - * A string of XHTML CSS tags. + * A string of themable XHTML CSS tags. */ function drupal_get_css($css = NULL) { $output = ''; @@ -2695,33 +2695,34 @@ function drupal_get_css($css = NULL) { // If CSS preprocessing is off, we still need to output the styles. // Additionally, go through any remaining styles if CSS preprocessing is on and output the non-cached ones. - $rendered_css = array(); - $inline_css = ''; - $external_css = ''; - $preprocess_items = array(); + $inline_items = array(); + $no_preprocess_items = array(); + $external_items = array(); + + // preprocess_items is a temp array of everything to be processed + // processed_items will store all processed files post-processing + $preprocess_items = array(); + $processed_items = array(); + foreach ($css as $data => $item) { - // Loop through each of the stylesheets, including them appropriately based - // on their type. + // Loop through each of the stylesheets, adding them to the appropriate array to send to theme function switch ($item['type']) { case 'file': // Depending on whether aggregation is desired, include the file. if (!$item['preprocess'] || !($is_writable && $preprocess_css)) { - $rendered_css[] = ''; + $no_preprocess_items[$item['media']][] = $item; } else { $preprocess_items[$item['media']][] = $item; - // Mark the position of the preprocess element, - // it should be at the position of the first preprocessed file. - $rendered_css['preprocess'] = ''; } break; - case 'inline': - // Include inline stylesheets. - $inline_css .= drupal_load_stylesheet_content($item['data'], $item['preprocess']); - break; case 'external': // Preprocessing for external CSS files is ignored. - $external_css .= '' . "\n"; + $external_items[$item['media']][] = $item; + break; + case 'inline': + // Include inline stylesheets. + $inline_items[] = $item; break; } } @@ -2732,16 +2733,20 @@ function drupal_get_css($css = NULL) { // starting with "ad*". $filename = 'css_' . md5(serialize($items) . $query_string) . '.css'; $preprocess_file = file_create_url(drupal_build_css_cache($items, $filename)); - $rendered_css['preprocess'] .= '' . "\n"; + $item = array( + 'type' => 'file', + 'media' => $media, + 'preprocess' => true, + 'data' => $preprocess_file + ); + $processed_items[$media][] = $item; } } - // Enclose the inline CSS with the style tag if required. - if (!empty($inline_css)) { - $inline_css = "\n" . ''; - } + + $css_items = array_merge($no_preprocess_items,$processed_items,$external_items); + + return(theme('css',$css_items,false,$query_string).theme('css',$inline_items,true,$query_string)); - // Output all the CSS files with the inline stylesheets showing up last. - return implode("\n", $rendered_css) . $external_css . $inline_css; } /** @@ -4580,6 +4585,9 @@ function drupal_common_theme() { 'status_messages' => array( 'arguments' => array('display' => NULL), ), + 'css' => array( + 'arguments' => array('css' => NULL, 'inline' => FALSE, 'query_string' => ''), + ), 'links' => array( 'arguments' => array('links' => NULL, 'attributes' => array('class' => array('links')), 'heading' => array()), ), diff -urp /Users/alex/Desktop/drupal/includes/theme.inc /Users/alex/Desktop/drupal_mod/includes/theme.inc --- /Users/alex/Desktop/drupal/includes/theme.inc 2009-09-21 02:36:54.000000000 -0400 +++ /Users/alex/Desktop/drupal_mod/includes/theme.inc 2009-09-28 13:41:30.000000000 -0400 @@ -1374,6 +1374,46 @@ function theme_status_messages($display } /** + * Return a themed set of XHTML or ' : ''; + } + + return $output; +} + +/** * Return a themed set of links. * * @param $links