summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2005-12-12 19:11:53 +0000
committerxue <>2005-12-12 19:11:53 +0000
commitac8108bce36a22f0db6fe10059ecdcf8d26cf23e (patch)
treeaf29b34624fe800a69fc93fb32169e9d25e7687a
parentab7c1394e8087a311e57e3b5be99b2805535062d (diff)
Added support to check recursively if a control has its viewstate enabled.
-rw-r--r--framework/Web/UI/TControl.php12
1 files 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);
}
/**