diff options
author | xue <> | 2006-08-05 21:34:30 +0000 |
---|---|---|
committer | xue <> | 2006-08-05 21:34:30 +0000 |
commit | b7f95ce37ae577e95a81e64aa2aaf3e2e698109d (patch) | |
tree | 85c6b9961ebbd4c9283fbd9b841703f9e4c47307 /framework/Web/UI/WebControls/TStyleSheet.php | |
parent | 550ba06593b467b643862d41a00ca2dd12ee704b (diff) |
merge from 3.0 branch till 1329.
Diffstat (limited to 'framework/Web/UI/WebControls/TStyleSheet.php')
-rw-r--r-- | framework/Web/UI/WebControls/TStyleSheet.php | 18 |
1 files changed, 17 insertions, 1 deletions
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 @@ -46,6 +46,22 @@ class TStyleSheet extends TControl } /** + * @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. * @param mixed event parameter @@ -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()); } /** |