From dc76ce6c04347a42bdd03b2c6060395d071ddb0e Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 2 Aug 2006 12:06:13 +0000 Subject: Fixed #316. --- framework/Web/UI/TClientScriptManager.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'framework/Web/UI/TClientScriptManager.php') diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php index 752b61ea..9a83c550 100644 --- a/framework/Web/UI/TClientScriptManager.php +++ b/framework/Web/UI/TClientScriptManager.php @@ -215,10 +215,14 @@ class TClientScriptManager extends TApplicationComponent * Registers a CSS file to be rendered in the page head * @param string a unique key identifying the file * @param string URL to the CSS file + * @param string media type of the CSS (such as 'print', 'screen', etc.). Defaults to empty, meaning the CSS applies to all media types. */ - public function registerStyleSheetFile($key,$url) + public function registerStyleSheetFile($key,$url,$media='') { - $this->_styleSheetFiles[$key]=$url; + if($media==='') + $this->_styleSheetFiles[$key]=$url; + else + $this->_styleSheetFiles[$key]=array($url,$media); } /** @@ -226,7 +230,7 @@ class TClientScriptManager extends TApplicationComponent * @param string a unique key identifying the CSS block * @param string CSS block */ - public function registerStyleSheet($key,$css) + public function registerStyleSheet($key,$css,$media='') { $this->_styleSheets[$key]=$css; } @@ -373,7 +377,12 @@ class TClientScriptManager extends TApplicationComponent { $str=''; foreach($this->_styleSheetFiles as $url) - $str.="\n"; + { + if(is_array($url)) + $str.="\n"; + else + $str.="\n"; + } $writer->write($str); } -- cgit v1.2.3