From 0b300b68cf9fde397c00abdc21917ac24aa042f0 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 12 Feb 2006 05:15:18 +0000 Subject: Added getAllowChildControls and TEmptyControlList. --- framework/Web/UI/TTemplateManager.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'framework/Web/UI/TTemplateManager.php') diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index 45884f02..abeb7466 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -252,6 +252,9 @@ class TTemplate extends TComponent implements ITemplate $controls=array(); foreach($this->_tpl as $key=>$object) { + $parent=isset($controls[$object[0]])?$controls[$object[0]]:$tplControl; + if(!$parent->getAllowChildControls()) + continue; if(isset($object[2])) // component { $component=Prado::createComponent($object[1]); @@ -270,7 +273,6 @@ class TTemplate extends TComponent implements ITemplate // apply attributes foreach($object[2] as $name=>$value) $this->configureControl($component,$name,$value); - $parent=isset($controls[$object[0]])?$controls[$object[0]]:$tplControl; $component->createdOnTemplate($parent); } else if($component instanceof TComponent) @@ -283,17 +285,11 @@ class TTemplate extends TComponent implements ITemplate } foreach($object[2] as $name=>$value) $this->configureComponent($component,$name,$value); - $parent=isset($controls[$object[0]])?$controls[$object[0]]:$tplControl; $parent->addParsedObject($component); } } else // string - { - if(isset($controls[$object[0]])) - $controls[$object[0]]->addParsedObject($object[1]); - else - $tplControl->addParsedObject($object[1]); - } + $parent->addParsedObject($object[1]); } } -- cgit v1.2.3