From 9bd22d04bfc3f78e4f29fdec2fab3c7a3c27de9a Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 31 Mar 2007 13:48:42 +0000 Subject: Fixed #571. --- HISTORY | 1 + framework/Web/UI/TPage.php | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/HISTORY b/HISTORY index 54ea4332..bfaaa06d 100644 --- a/HISTORY +++ b/HISTORY @@ -29,6 +29,7 @@ ENH: Ticket#519 - Update TActiveRecord implementation (Wei) ENH: Ticket#537 - TActiveRecord Pk info ENH [usage: http://trac.pradosoft.com/prado/ticket/537] (Wei) ENH: Ticket#561 - Powered by PRADO image to become an asset (Qiang) ENH: Ticket#569 - Added TTextBox.PersistPassword property (Qiang) +ENH: Ticket#571 - Made TPage.ClientSupportsJavaScript property writable (Qiang) ENH: Added PRADO_CHMOD constant so that users can specify the permission of PRADO-created directories (Qiang) ENH: Added Display property to TWebControl (Wei) ENH: Added TUser.getState() and setState() for storing user session data (Qiang) 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