diff options
author | xue <> | 2006-08-30 12:33:43 +0000 |
---|---|---|
committer | xue <> | 2006-08-30 12:33:43 +0000 |
commit | 1f560ccd8a9e21871dbedd548fc97f231131c771 (patch) | |
tree | 90d054108a0bce4668ca16d425655b22c99ed6d3 /framework/Web/UI/TTemplateManager.php | |
parent | f4482f9c17825b63242fee42252e097dd85f53c5 (diff) |
merge from 3.0 branch till 1363.
Diffstat (limited to 'framework/Web/UI/TTemplateManager.php')
-rw-r--r-- | framework/Web/UI/TTemplateManager.php | 14 |
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 +?>
|