Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
304
Merge Requests
304
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
8660655a
Commit
8660655a
authored
Aug 05, 2005
by
Steven Wittens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-
#27981
: Add media parameter to theme_add_style
parent
3feef48d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
includes/theme.inc
includes/theme.inc
+10
-7
No files found.
includes/theme.inc
View file @
8660655a
...
...
@@ -349,9 +349,12 @@ function theme_get_setting($setting_name, $refresh = FALSE) {
* Add a theme stylesheet to be included later. This is handled separately from
* drupal_set_html_head() to enforce the correct CSS cascading order.
*/
function
theme_add_style
(
$
style
=
'
'
)
{
function
theme_add_style
(
$
path
=
''
,
$media
=
'all
'
)
{
static
$styles
=
array
();
if
(
$style
)
{
if
(
$path
)
{
$style
=
new
stdClass
();
$style
->
path
=
$path
;
$style
->
media
=
$media
;
$styles
[]
=
$style
;
}
return
$styles
;
...
...
@@ -363,7 +366,7 @@ function theme_add_style($style = '') {
function
theme_get_styles
()
{
$output
=
''
;
foreach
(
theme_add_style
()
as
$style
)
{
$output
.
=
theme
(
'stylesheet_import'
,
$style
);
$output
.
=
theme
(
'stylesheet_import'
,
$style
->
path
,
$style
->
media
);
}
return
$output
;
}
...
...
@@ -833,8 +836,8 @@ function theme_mark($type = MARK_NEW) {
/**
* Import a stylesheet using @import.
*
* @param $
stylesheet
* The
filename to point the link a
t.
* @param $
path
* The
path to the styleshee
t.
*
* @param $media
* The media type to specify for the stylesheet
...
...
@@ -842,8 +845,8 @@ function theme_mark($type = MARK_NEW) {
* @return
* A string containing the HTML for the stylesheet import.
*/
function
theme_stylesheet_import
(
$
stylesheet
,
$media
=
'all'
)
{
return
'<style type="text/css" media="'
.
$media
.
'">@import "'
.
$
stylesheet
.
'";</style>'
;
function
theme_stylesheet_import
(
$
path
,
$media
=
'all'
)
{
return
'<style type="text/css" media="'
.
$media
.
'">@import "'
.
$
path
.
'";</style>'
;
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment