summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TTemplateManager.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/TTemplateManager.php')
-rw-r--r--framework/Web/UI/TTemplateManager.php24
1 files changed, 9 insertions, 15 deletions
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index 566f6876..41ff76e1 100644
--- a/framework/Web/UI/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
@@ -423,17 +423,10 @@ class TTemplate extends TApplicationComponent implements ITemplate
{
if(strncasecmp($name,'on',2)===0) // is an event
$this->configureEvent($control,$name,$value,$control);
- else {
- if(strncasecmp($name,'js',2)===0)
- {
- $name=substr($name,2);
- $value=TJavaScript::quoteJsLiteral($value);
- }
- 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);
- }
+ 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);
}
/**
@@ -513,6 +506,9 @@ class TTemplate extends TApplicationComponent implements ITemplate
}
else
{
+ if (substr($name,0,2)=='js')
+ if ($value and !($value instanceof TJavaScriptLiteral))
+ $value = new TJavaScriptLiteral($value);
$setter='set'.$name;
$component->$setter($value);
}
@@ -944,12 +940,10 @@ class TTemplate extends TApplicationComponent implements ITemplate
}
else
{
- if(strncasecmp($name,'js',2)===0)
- $name=substr($name, 2);
// a simple property
- if(!$class->hasMethod('set'.$name))
+ if (! ($class->hasMethod('set'.$name) || $class->hasMethod('setjs'.$name)) )
{
- if($class->hasMethod('get'.$name))
+ if ($class->hasMethod('get'.$name) || $class->hasMethod('getjs'.$name))
throw new TConfigurationException('template_property_readonly',$type,$name);
else
throw new TConfigurationException('template_property_unknown',$type,$name);