summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TTemplateManager.php
diff options
context:
space:
mode:
authorxue <>2007-10-03 21:21:40 +0000
committerxue <>2007-10-03 21:21:40 +0000
commit9b833015fcb1abffe80685a8ee5231ade9bd4923 (patch)
tree536de7a1646d1bc87ab645d8955e1befe2bc2f63 /framework/Web/UI/TTemplateManager.php
parent7114280214ab22250c3ddd12509c2e388936a304 (diff)
Fixed TConditional parent-child relationship.
Diffstat (limited to 'framework/Web/UI/TTemplateManager.php')
-rw-r--r--framework/Web/UI/TTemplateManager.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index 53058a9f..5a6faba6 100644
--- a/framework/Web/UI/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
@@ -302,14 +302,14 @@ class TTemplate extends TApplicationComponent implements ITemplate
* Instantiates the template.
* Content in the template will be instantiated as components and text strings
* and passed to the specified parent control.
- * @param TControl the parent control
- * @param TControl the control with which explicitly named controls are registered. If null, it uses the parent control.
+ * @param TControl the control who owns the template
+ * @param TControl the control who will become the root parent of the controls on the template. If null, it uses the template control.
*/
- public function instantiateIn($tplControl,$namingControl=null)
+ public function instantiateIn($tplControl,$parentControl=null)
{
$this->_tplControl=$tplControl;
- if($namingControl===null)
- $namingControl=$tplControl;
+ if($parentControl===null)
+ $parentControl=$tplControl;
if(($page=$tplControl->getPage())===null)
$page=$this->getService()->getRequestedPage();
$controls=array();
@@ -317,7 +317,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
foreach($this->_tpl as $key=>$object)
{
if($object[0]===-1)
- $parent=$tplControl;
+ $parent=$parentControl;
else if(isset($controls[$object[0]]))
$parent=$controls[$object[0]];
else
@@ -335,7 +335,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
{
if(is_array($properties['id']))
$properties['id']=$component->evaluateExpression($properties['id'][1]);
- $namingControl->registerObject($properties['id'],$component);
+ $tplControl->registerObject($properties['id'],$component);
}
if(isset($properties['skinid']))
{
@@ -354,7 +354,7 @@ class TTemplate extends TApplicationComponent implements ITemplate
$component->trackViewState(true);
- if($parent===$tplControl)
+ if($parent===$parentControl)
$directChildren[]=$component;
else
$component->createdOnTemplate($parent);
@@ -368,13 +368,13 @@ class TTemplate extends TApplicationComponent implements ITemplate
{
if(is_array($properties['id']))
$properties['id']=$component->evaluateExpression($properties['id'][1]);
- $namingControl->registerObject($properties['id'],$component);
+ $tplControl->registerObject($properties['id'],$component);
if(!$component->hasProperty('id'))
unset($properties['id']);
}
foreach($properties as $name=>$value)
$this->configureComponent($component,$name,$value);
- if($parent===$tplControl)
+ if($parent===$parentControl)
$directChildren[]=$component;
else
$component->createdOnTemplate($parent);
@@ -387,14 +387,14 @@ class TTemplate extends TApplicationComponent implements ITemplate
// need to clone a new object because the one in template is reused
$o=clone $object[1];
$o->setContainer($tplControl);
- if($parent===$tplControl)
+ if($parent===$parentControl)
$directChildren[]=$o;
else
$parent->addParsedObject($o);
}
else
{
- if($parent===$tplControl)
+ if($parent===$parentControl)
$directChildren[]=$object[1];
else
$parent->addParsedObject($object[1]);
@@ -407,9 +407,9 @@ class TTemplate extends TApplicationComponent implements ITemplate
foreach($directChildren as $control)
{
if($control instanceof TComponent)
- $control->createdOnTemplate($tplControl);
+ $control->createdOnTemplate($parentControl);
else
- $tplControl->addParsedObject($control);
+ $parentControl->addParsedObject($control);
}
}