summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TTemplateManager.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/TTemplateManager.php')
-rw-r--r--framework/Web/UI/TTemplateManager.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index c13b5a9d..b3317709 100644
--- a/framework/Web/UI/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
@@ -286,11 +286,8 @@ class TTemplate extends TApplicationComponent implements ITemplate
$directChildren=array();
foreach($this->_tpl as $key=>$object)
{
- if($object[0]===-1)
- $parent=$tplControl;
- else if(isset($controls[$object[0]]))
- $parent=$controls[$object[0]];
- else
+ $parent=isset($controls[$object[0]])?$controls[$object[0]]:$tplControl;
+ if(($parent instanceof TControl) && !$parent->getAllowChildControls())
continue;
if(isset($object[2])) // component
{
@@ -328,6 +325,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
}
else if($component instanceof TComponent)
{
+ $controls[$key]=$component;
if(isset($properties['id']))
{
if(is_array($properties['id']))
@@ -341,7 +339,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
if($parent===$tplControl)
$directChildren[]=$component;
else
- $parent->addParsedObject($component);
+ $component->createdOnTemplate($parent);
}
}
else
@@ -370,7 +368,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
// if the child needs its own child controls.
foreach($directChildren as $control)
{
- if($control instanceof TControl)
+ if($control instanceof TComponent)
$control->createdOnTemplate($tplControl);
else
$tplControl->addParsedObject($control);
@@ -950,4 +948,4 @@ class TTemplate extends TApplicationComponent implements ITemplate
}
}
-?> \ No newline at end of file
+?>