diff options
author | xue <> | 2006-08-28 02:21:48 +0000 |
---|---|---|
committer | xue <> | 2006-08-28 02:21:48 +0000 |
commit | 5a55bca3e31f4cefa2b3fa6e854431db91528837 (patch) | |
tree | 5e3ac35cce2397059e9165cc1edcc7faf8988ba5 /framework/Web/UI/TTemplateManager.php | |
parent | 304427074ddf629fd2708b23a3fe0cd0122c05a8 (diff) |
Moved createdOnTemplate() and addParsedObject() from TControl to TComponent so that template instantiation is more consistent among non-control components and controls.
Diffstat (limited to 'framework/Web/UI/TTemplateManager.php')
-rw-r--r-- | framework/Web/UI/TTemplateManager.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index 1fde4acc..79c163fb 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -266,7 +266,7 @@ class TTemplate extends TApplicationComponent implements ITemplate foreach($this->_tpl as $key=>$object)
{
$parent=isset($controls[$object[0]])?$controls[$object[0]]:$tplControl;
- if(!$parent->getAllowChildControls())
+ if(($parent instanceof TControl) && !$parent->getAllowChildControls())
continue;
if(isset($object[2])) // component
{
@@ -301,6 +301,7 @@ class TTemplate extends TApplicationComponent implements ITemplate }
else if($component instanceof TComponent)
{
+ $controls[$key]=$component;
if(isset($properties['id']))
{
if(is_array($properties['id']))
@@ -314,7 +315,7 @@ class TTemplate extends TApplicationComponent implements ITemplate if($parent===$tplControl)
$directChildren[]=$component;
else
- $parent->addParsedObject($component);
+ $component->createdOnTemplate($parent);
}
}
else // string
@@ -343,7 +344,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);
|