summaryrefslogtreecommitdiff
path: root/framework/Web/UI
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI')
-rw-r--r--framework/Web/UI/ActiveControls/TAutoComplete.php2
-rwxr-xr-xframework/Web/UI/ActiveControls/TDropContainer.php2
-rw-r--r--framework/Web/UI/TClientScriptManager.php4
-rw-r--r--framework/Web/UI/TTemplateManager.php17
-rw-r--r--framework/Web/UI/WebControls/TAccordion.php4
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php6
-rw-r--r--framework/Web/UI/WebControls/TSlider.php8
-rw-r--r--framework/Web/UI/WebControls/TTabPanel.php8
8 files changed, 30 insertions, 21 deletions
diff --git a/framework/Web/UI/ActiveControls/TAutoComplete.php b/framework/Web/UI/ActiveControls/TAutoComplete.php
index cc63deae..2c160578 100644
--- a/framework/Web/UI/ActiveControls/TAutoComplete.php
+++ b/framework/Web/UI/ActiveControls/TAutoComplete.php
@@ -328,7 +328,7 @@ class TAutoComplete extends TActiveTextBox implements INamingContainer
{
$string = strtr($string,array('\t'=>"\t",'\n'=>"\n",'\r'=>"\r"));
$token = preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY);
- $options['tokens'] = TJavaScript::encode($token,false);
+ $options['tokens'] = $token;
}
if($this->getAutoPostBack())
{
diff --git a/framework/Web/UI/ActiveControls/TDropContainer.php b/framework/Web/UI/ActiveControls/TDropContainer.php
index e6933147..daa8469b 100755
--- a/framework/Web/UI/ActiveControls/TDropContainer.php
+++ b/framework/Web/UI/ActiveControls/TDropContainer.php
@@ -157,7 +157,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan
$options['ID'] = $this->getClientID();
$options['EventTarget'] = $this->getUniqueID();
- $options['accept'] = TJavascript::encode($this->getAcceptCssClass());
+ $options['accept'] = $this->getAcceptCssClass();
$options['hoverclass'] = $this->getHoverCssClass();
return $options;
}
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php
index 1804c9d1..3f1664ac 100644
--- a/framework/Web/UI/TClientScriptManager.php
+++ b/framework/Web/UI/TClientScriptManager.php
@@ -800,8 +800,8 @@ abstract class TClientSideOptions extends TComponent
*/
protected function setFunction($name, $code)
{
- if(!TJavaScript::isFunction($code))
- $code = TJavaScript::quoteFunction($this->ensureFunction($code));
+ if(!TJavaScript::isJsLiteral($code))
+ $code = TJavaScript::quoteJsLiteral($this->ensureFunction($code));
$this->setOption($name, $code);
}
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index a5e635da..566f6876 100644
--- a/framework/Web/UI/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
@@ -423,10 +423,17 @@ class TTemplate extends TApplicationComponent implements ITemplate
{
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
- $this->configureSubProperty($control,$name,$value);
+ 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);
+ }
}
/**
@@ -937,6 +944,8 @@ 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))
{
diff --git a/framework/Web/UI/WebControls/TAccordion.php b/framework/Web/UI/WebControls/TAccordion.php
index 60494617..4e1cd325 100644
--- a/framework/Web/UI/WebControls/TAccordion.php
+++ b/framework/Web/UI/WebControls/TAccordion.php
@@ -489,10 +489,10 @@ class TAccordion extends TWebControl implements IPostBackDataHandler
{
if($views!='')
$views.=', ';
- $views.= '"'.$view->getClientID().'":'.($view->getVisible() ? '1': '0' );
+ $views.= TJavaScript::encode($view->getClientID()).':'.($view->getVisible() ? '1': '0' );
}
- $options['Views']='{'.$views.='}';
+ $options['Views']=TJavaScript::quoteJsLiteral('{'.$views.='}');
$viewIDs=array();
return $options;
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php
index 6d2f1427..a0dee3d4 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -563,9 +563,9 @@ class TDatePicker extends TTextBox
return array();
$date = $this->getLocalizedCalendarInfo();
- $options['MonthNames'] = TJavaScript::encode($date->getMonthNames(),false);
- $options['AbbreviatedMonthNames'] = TJavaScript::encode($date->getAbbreviatedMonthNames(),false);
- $options['ShortWeekDayNames'] = TJavaScript::encode($date->getAbbreviatedDayNames(),false);
+ $options['MonthNames'] = $date->getMonthNames();
+ $options['AbbreviatedMonthNames'] = $date->getAbbreviatedMonthNames();
+ $options['ShortWeekDayNames'] = $date->getAbbreviatedDayNames();
return $options;
}
diff --git a/framework/Web/UI/WebControls/TSlider.php b/framework/Web/UI/WebControls/TSlider.php
index f453e3ac..5dc65d47 100644
--- a/framework/Web/UI/WebControls/TSlider.php
+++ b/framework/Web/UI/WebControls/TSlider.php
@@ -457,7 +457,7 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer
$options['axis'] = strtolower($this->getDirection());
$options['maximum'] = $maxValue;
$options['minimum'] = $minValue;
- $options['range'] = TJavascript::quoteFunction('$R('.$minValue.",".$maxValue.")");
+ $options['range'] = TJavascript::quoteJsLiteral('$R('.$minValue.",".$maxValue.")");
$options['sliderValue'] = $this->getValue();
$options['disabled'] = !$this->getEnabled();
$values=$this->getValues();
@@ -488,7 +488,7 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer
// Add max if it's not in the array because of step
if (!in_array($maxValue, $values)) $values[]=$maxValue;
}
- $options['values'] = TJavaScript::Encode($values,false);
+ $options['values'] = $values;
if($this->_clientScript!==null)
$options = array_merge($options,$this->_clientScript->getOptions()->toArray());
return $options;
@@ -520,7 +520,7 @@ class TSliderClientScript extends TClientSideOptions
*/
public function setOnChange($javascript)
{
- $code=TJavascript::quoteFunction("function (value) { {$javascript} }");
+ $code=TJavascript::quoteJsLiteral("function (value) { {$javascript} }");
$this->setFunction('onChange', $code);
}
@@ -537,7 +537,7 @@ class TSliderClientScript extends TClientSideOptions
*/
public function setOnSlide($javascript)
{
- $code=TJavascript::quoteFunction("function (value) { {$javascript} }");
+ $code=TJavascript::quoteJsLiteral("function (value) { {$javascript} }");
$this->setFunction('onSlide', $code);
}
diff --git a/framework/Web/UI/WebControls/TTabPanel.php b/framework/Web/UI/WebControls/TTabPanel.php
index a1ddca39..558ead4e 100644
--- a/framework/Web/UI/WebControls/TTabPanel.php
+++ b/framework/Web/UI/WebControls/TTabPanel.php
@@ -443,11 +443,11 @@ class TTabPanel extends TWebControl implements IPostBackDataHandler
$viewVis=array();
foreach($this->getViews() as $view)
{
- $viewIDs[]=$view->getClientID();
- $viewVis[]=$view->getVisible();
+ $viewIDs[]=TJavaScript::encode($view->getClientID());
+ $viewVis[]=TJavaScript::encode($view->getVisible());
}
- $options['Views']='[\''.implode('\',\'',$viewIDs).'\']';
- $options['ViewsVis']='[\''.implode('\',\'',$viewVis).'\']';
+ $options['Views']=TJavaScript::quoteJsLiteral('['.implode(',',$viewIDs).']');
+ $options['ViewsVis']=TJavaScript::quoteJsLiteral('['.implode(',',$viewVis).']');
return $options;
}