diff options
Diffstat (limited to 'framework/Web/UI/TTemplateManager.php')
-rw-r--r-- | framework/Web/UI/TTemplateManager.php | 10 |
1 files changed, 7 insertions, 3 deletions
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)
{
|