summaryrefslogtreecommitdiff
path: root/includes/theme.inc
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2005-08-05 00:22:03 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2005-08-05 00:22:03 +0000
commit8660655a9ab684ce8ba64415f59c175078e6fdc1 (patch)
tree565342c6ee8e7e8749405737fdfb9c96b74adde5 /includes/theme.inc
parent3feef48da221d7ff2ea0c120b83a81d1266ed3c6 (diff)
downloadbrdo-8660655a9ab684ce8ba64415f59c175078e6fdc1.tar.gz
brdo-8660655a9ab684ce8ba64415f59c175078e6fdc1.tar.bz2
- #27981: Add media parameter to theme_add_style
Diffstat (limited to 'includes/theme.inc')
-rw-r--r--includes/theme.inc17
1 files changed, 10 insertions, 7 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index 501d80715..04add76e6 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -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 at.
+ * @param $path
+ * The path to the stylesheet.
*
* @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>';
}
/**