From 9bd22d04bfc3f78e4f29fdec2fab3c7a3c27de9a Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 31 Mar 2007 13:48:42 +0000 Subject: Fixed #571. --- framework/Web/UI/TPage.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'framework/Web/UI') diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php index 96ac6d36..59a3e859 100644 --- a/framework/Web/UI/TPage.php +++ b/framework/Web/UI/TPage.php @@ -157,6 +157,10 @@ class TPage extends TTemplateControl * @var boolean true if loading post data. */ private $_isLoadingPostData=false; + /** + * @var boolean whether client supports javascript + */ + private $_enableJavaScript=true; /** * Constructor. @@ -953,14 +957,19 @@ class TPage extends TTemplateControl } /** - * @return boolean whether client supports javascript. Currently, this - * method always returns true. If future, we may add some browser capability - * detection functionality. + * @return boolean whether client supports javascript. Defaults to true. */ public function getClientSupportsJavaScript() { - // todo - return true; + return $this->_enableJavaScript; + } + + /** + * @param boolean whether client supports javascript. If false, javascript will not be generated for controls. + */ + public function setClientSupportsJavaScript($value) + { + $this->_enableJavaScript=TPropertyValue::ensureBoolean($value); } /** -- cgit v1.2.3