summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TTemplateManager.php
diff options
context:
space:
mode:
authorxue <>2006-02-12 05:15:18 +0000
committerxue <>2006-02-12 05:15:18 +0000
commit0b300b68cf9fde397c00abdc21917ac24aa042f0 (patch)
tree7d4d10aa051d3a5f832b4298d9278fce140e067d /framework/Web/UI/TTemplateManager.php
parentc6cf2568bd186fe46dea6aeefec17e046a595b52 (diff)
Added getAllowChildControls and TEmptyControlList.
Diffstat (limited to 'framework/Web/UI/TTemplateManager.php')
-rw-r--r--framework/Web/UI/TTemplateManager.php12
1 files changed, 4 insertions, 8 deletions
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]);
}
}