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/WebControls/TStyleSheet.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'framework/Web/UI/WebControls/TStyleSheet.php') diff --git a/framework/Web/UI/WebControls/TStyleSheet.php b/framework/Web/UI/WebControls/TStyleSheet.php index 5925645c..3e172697 100644 --- a/framework/Web/UI/WebControls/TStyleSheet.php +++ b/framework/Web/UI/WebControls/TStyleSheet.php @@ -45,6 +45,22 @@ class TStyleSheet extends TControl return $this->getViewState('StyleSheetUrl', ''); } + /** + * @return string media type of the CSS (such as 'print', 'screen', etc.). Defaults to empty, meaning the CSS applies to all media types. + */ + public function getMediaType() + { + return $this->getViewState('MediaType',''); + } + + /** + * @param string media type of the CSS (such as 'print', 'screen', etc.). If empty, it means the CSS applies to all media types. + */ + public function setMediaType($value) + { + $this->setViewState('MediaType',$value,''); + } + /** * Registers the stylesheet file and content to be rendered. * This method overrides the parent implementation and is invoked right before rendering. @@ -53,7 +69,7 @@ class TStyleSheet extends TControl public function onPreRender($param) { if(($url=$this->getStyleSheetUrl())!=='') - $this->getPage()->getClientScript()->registerStyleSheetFile($url,$url); + $this->getPage()->getClientScript()->registerStyleSheetFile($url,$url,$this->getMediaType()); } /** -- cgit v1.2.3