summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt3
-rw-r--r--template.php30
-rw-r--r--zen_classic/template.php5
3 files changed, 34 insertions, 4 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 0b1381d..87c3043 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,4 +1,5 @@
-Zen 5.x-1.x-dev
+Zen 5.x-0.8
+ * #196223: IE5 always loads @import print stylesheet
* #184232: Add README documentation
* #121991: Source rendering order needs adjustment
* #110897: oversize content causes IE6 layout breakage
diff --git a/template.php b/template.php
index d36be35..394287b 100644
--- a/template.php
+++ b/template.php
@@ -176,9 +176,10 @@ function _phptemplate_variables($hook, $vars = array()) {
drupal_add_css($vars['directory'] .'/html-elements.css', 'theme', 'all');
drupal_add_css($vars['directory'] .'/tabs.css', 'theme', 'all');
drupal_add_css($vars['directory'] .'/zen.css', 'theme', 'all');
- drupal_add_css($vars['directory'] .'/print.css', 'theme', 'print');
$vars['css'] = drupal_add_css();
$vars['styles'] = drupal_get_css();
+ // Avoid IE5 bug that always loads @import print stylesheets
+ $vars['head'] = zen_add_print_css($vars['directory'] .'/print.css');
}
// Send a new variable, $logged_in, to page.tpl.php to tell us if the
@@ -328,3 +329,30 @@ function zen_id_safe($string) {
}
return strtolower(preg_replace('/[^a-zA-Z0-9-]+/', '-', $string));
}
+
+/**
+ * Adds a print stylesheet to the page's $head variable.
+ *
+ * This is a work-around for a serious bug in IE5 in which it loads print
+ * stylesheets for screen display when using an @import method, Drupal's default
+ * method when using drupal_add_css().
+ *
+ * @param string $url
+ * The URL of the print stylesheet
+ * @return
+ * All the rendered links for the $head variable
+ */
+function zen_add_print_css($url) {
+ global $base_path;
+ return drupal_set_html_head(
+ '<link'.
+ drupal_attributes(
+ array(
+ 'rel' => 'stylesheet',
+ 'href' => $base_path . $url,
+ 'type' => 'text/css',
+ 'media' => 'print',
+ )
+ ) ." />\n"
+ );
+}
diff --git a/zen_classic/template.php b/zen_classic/template.php
index c2eed4e..d03898d 100644
--- a/zen_classic/template.php
+++ b/zen_classic/template.php
@@ -72,15 +72,16 @@ function zen_variables($hook, $vars) {
drupal_add_css($vars['directory'] .'/tabs.css', 'theme', 'all');
// Then add styles for this sub-theme.
drupal_add_css($vars['subtheme_directory'] .'/layout.css', 'theme', 'all');
- drupal_add_css($vars['subtheme_directory'] .'/print.css', 'theme', 'print');
- drupal_add_css($vars['subtheme_directory'] .'/zen-classic.css', 'theme', 'all');
drupal_add_css($vars['subtheme_directory'] .'/icons.css', 'theme', 'all');
+ drupal_add_css($vars['subtheme_directory'] .'/zen-classic.css', 'theme', 'all');
// Optionally add the fixed width CSS file.
if (theme_get_setting('zen_classic_fixed')) {
drupal_add_css($vars['subtheme_directory'] .'/zen-fixed.css', 'theme', 'all');
}
$vars['css'] = drupal_add_css();
$vars['styles'] = drupal_get_css();
+ // Avoid IE5 bug that always loads @import print stylesheets
+ $vars['head'] = zen_add_print_css($vars['subtheme_directory'] .'/print.css');
}
return $vars;
}