I created a patch that adds a parameter to the [tt]regClientCSS[/tt] function to allow the media="" tag. If nobody has any objections I’ll commit it to 095dev branch. The second parameter is optional of course
Index: manager/includes/document.parser.class.inc.php
===================================================================
--- manager/includes/document.parser.class.inc.php (revision 2457)
+++ manager/includes/document.parser.class.inc.php (working copy)
@@ -2157,14 +2157,14 @@
}
# Registers Client-side CSS scripts - these scripts are loaded at inside the <head> tag
- function regClientCSS($src) {
+ function regClientCSS($src, $media='') {
if (isset ($this->loadedjscripts[$src]) && $this->loadedjscripts[$src])
return '';
$this->loadedjscripts[$src]= true;
if (strpos(strtolower($src), "<style") !== false || strpos(strtolower($src), "<link") !== false) {
$this->sjscripts[count($this->sjscripts)]= $src;
} else {
- $this->sjscripts[count($this->sjscripts)]= '<!-- MODx registered -->' . "\n" . ' <link rel="stylesheet" href="' . $src . '" />';
+ $this->sjscripts[count($this->sjscripts)]= '<!-- MODx registered -->' . "\n\t" . '<link rel="stylesheet" type="text/css" href="'.$src.'" '.($media ? 'media="'.$media.'" ' : '').'/>';
}
}