From d8122a0f98137822b0ea20f7602d105fcb2fe962 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 9 Apr 2006 01:50:08 +0000 Subject: Fixed a few bugs in TOutputCache. Documentation for TOutputCache is completed. --- framework/Web/UI/TTemplateManager.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'framework/Web/UI/TTemplateManager.php') diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index fa4cbcbf..73a336c8 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -262,8 +262,11 @@ class TTemplate extends TApplicationComponent implements ITemplate $controls=array(); foreach($this->_tpl as $key=>$object) { - $parent=isset($controls[$object[0]])?$controls[$object[0]]:$tplControl; - if(!$parent->getAllowChildControls()) + if($object[0]===-1) + $parent=$tplControl; + else if(isset($controls[$object[0]])) + $parent=$controls[$object[0]]; + else continue; if(isset($object[2])) // component { @@ -271,7 +274,6 @@ class TTemplate extends TApplicationComponent implements ITemplate $properties=&$object[2]; if($component instanceof TControl) { - $controls[$key]=$component; $component->setTemplateControl($tplControl); if(isset($properties['id'])) { @@ -292,6 +294,8 @@ class TTemplate extends TApplicationComponent implements ITemplate foreach($properties as $name=>$value) $this->configureControl($component,$name,$value); $component->createdOnTemplate($parent); + if($component->getAllowChildControls()) + $controls[$key]=$component; } else if($component instanceof TComponent) { -- cgit v1.2.3