summaryrefslogtreecommitdiff
path: root/framework/Web/UI
diff options
context:
space:
mode:
authorxue <>2006-01-30 04:46:34 +0000
committerxue <>2006-01-30 04:46:34 +0000
commit984ffd32335727c8329cb15d777fbc9adc0d3052 (patch)
tree34f8a137ba67403797732114bafcab32a9671c57 /framework/Web/UI
parentf7b1db61531f9309dc9a1b9587449442a7ae5ed5 (diff)
Modified viewstate saving method so that much smaller state data is generated.
Diffstat (limited to 'framework/Web/UI')
-rw-r--r--framework/Web/UI/TControl.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php
index 8b272f30..7b9fee4e 100644
--- a/framework/Web/UI/TControl.php
+++ b/framework/Web/UI/TControl.php
@@ -1320,12 +1320,14 @@ class TControl extends TComponent
{
if(isset($state[$control->_id]))
{
- $s=&$state[$control->_id];
+ $control->loadStateRecursive($state[$control->_id],$needViewState);
unset($state[$control->_id]);
}
else
- $s=null;
- $control->loadStateRecursive($s,$needViewState);
+ {
+ $s=array();
+ $control->loadStateRecursive($s,$needViewState);
+ }
}
}
}
@@ -1339,9 +1341,9 @@ class TControl extends TComponent
}
/**
- * Saves the all control state (viewstate and controlstate) as a collection.
+ * Saves all control state (viewstate and controlstate) as a collection.
* @param boolean whether the viewstate should be saved
- * @return TMap the collection of the control state (including its children's state).
+ * @return array the collection of the control state (including its children's state).
*/
final protected function &saveStateRecursive($needViewState=true)
{
@@ -1355,11 +1357,12 @@ class TControl extends TComponent
if($control instanceof TControl)
{
$cs=&$control->saveStateRecursive($needViewState);
- $state[$control->_id]=&$cs;
+ if(!empty($cs))
+ $state[$control->_id]=&$cs;
}
}
}
- if($needViewState)
+ if($needViewState && !empty($this->_viewState))
$state[0]=&$this->_viewState;
if(isset($this->_rf[self::RF_CONTROLSTATE]))
$state[1]=&$this->_rf[self::RF_CONTROLSTATE];