summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TTemplateManager.php
diff options
context:
space:
mode:
authorxue <>2006-06-02 18:27:02 +0000
committerxue <>2006-06-02 18:27:02 +0000
commit0f3a577bed4d828472469675e90fcab032e33f44 (patch)
tree3ca817247b8006563900d5fb8995d6a6f0627a2b /framework/Web/UI/TTemplateManager.php
parent067ab51fbd9b2f18f63fc80895476e5b0e2f9bfb (diff)
merge from 3.0 branch till 1133.
Diffstat (limited to 'framework/Web/UI/TTemplateManager.php')
-rw-r--r--framework/Web/UI/TTemplateManager.php34
1 files changed, 28 insertions, 6 deletions
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index 60ce11ca..cb05fa35 100644
--- a/framework/Web/UI/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
@@ -383,16 +383,37 @@ class TTemplate extends TApplicationComponent implements ITemplate
* @param string property name
* @param mixed property initial value
*/
+ protected function configureControl2($control,$name,$value)
+ {
+ if(strncasecmp($name,'on',2)===0) // is an event
+ $this->configureEvent($control,$name,$value,$control);
+ else if(($pos=strrpos($name,'.'))===false) // is a simple property or custom attribute
+ $this->configureProperty($control,$name,$value);
+ else // is a subproperty
+ {
+ $subName=substr($name,$pos+1);
+ if(strncasecmp($subName,'on',2)===0) // is an event: XXX.YYY.OnZZZ
+ {
+ $object=$control->getSubProperty(substr($name,0,$pos));
+ if(($object instanceof TControl))
+ $this->configureEvent($object,$subName,$value,$control);
+ else
+ $this->configureSubProperty($control,$name,$value);
+ }
+ else
+ $this->configureSubProperty($control,$name,$value);
+ }
+ }
+
protected function configureControl($control,$name,$value)
{
if(strncasecmp($name,'on',2)===0) // is an event
- $this->configureEvent($control,$name,$value);
- else if(strpos($name,'.')===false) // is a simple property or custom attribute
+ $this->configureEvent($control,$name,$value,$control);
+ else if(($pos=strrpos($name,'.'))===false) // is a simple property or custom attribute
$this->configureProperty($control,$name,$value);
else // is a subproperty
$this->configureSubProperty($control,$name,$value);
}
-
/**
* Configures a property of a non-control component.
* @param TComponent component to be configured
@@ -412,13 +433,14 @@ class TTemplate extends TApplicationComponent implements ITemplate
* @param TControl control to be configured
* @param string event name
* @param string event handler
+ * @param TControl context control
*/
- protected function configureEvent($component,$name,$value)
+ protected function configureEvent($control,$name,$value,$contextControl)
{
if(strpos($value,'.')===false)
- $component->attachEventHandler($name,array($component,'TemplateControl.'.$value));
+ $control->attachEventHandler($name,array($contextControl,'TemplateControl.'.$value));
else
- $component->attachEventHandler($name,array($component,$value));
+ $control->attachEventHandler($name,array($contextControl,$value));
}
/**