From ac8108bce36a22f0db6fe10059ecdcf8d26cf23e Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 12 Dec 2005 19:11:53 +0000 Subject: Added support to check recursively if a control has its viewstate enabled. --- framework/Web/UI/TControl.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index a4625d18..435f3905 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -600,9 +600,17 @@ class TControl extends TComponent /** * @return boolean whether viewstate is enabled */ - public function getEnableViewState() + public function getEnableViewState($checkParents=false) { - return !($this->_flags & self::IS_DISABLE_VIEWSTATE); + if($checkParents) + { + for($control=$this;$control!==null;$control=$control->getParent()) + if($control->_flags & self::IS_DISABLE_VIEWSTATE) + return false; + return true; + } + else + return !($this->_flags & self::IS_DISABLE_VIEWSTATE); } /** -- cgit v1.2.3