Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zen-2967607
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
zen-2967607
Commits
a3e25d2e
Commit
a3e25d2e
authored
17 years ago
by
John Albin Wilkins
Browse files
Options
Downloads
Patches
Plain Diff
#196223
: IE5 always loads @import print stylesheet
parent
b2a804ac
Branches
1.0.x
Branches containing commit
Tags
1.0.0-alpha5
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.txt
+2
-1
2 additions, 1 deletion
CHANGELOG.txt
template.php
+29
-1
29 additions, 1 deletion
template.php
zen_classic/template.php
+3
-2
3 additions, 2 deletions
zen_classic/template.php
with
34 additions
and
4 deletions
CHANGELOG.txt
+
2
−
1
View file @
a3e25d2e
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
...
...
This diff is collapsed.
Click to expand it.
template.php
+
29
−
1
View file @
a3e25d2e
...
...
@@ -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
"
);
}
This diff is collapsed.
Click to expand it.
zen_classic/template.php
+
3
−
2
View file @
a3e25d2e
...
...
@@ -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
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment