From 76d7735f8de76dfc4fa0ff671e5f18ae025bbcf3 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Sat, 24 Mar 2012 22:52:29 +0000 Subject: Committer 2nd part of patch for #391 --- framework/Web/UI/WebControls/TAccordion.php | 4 ++-- framework/Web/UI/WebControls/TDatePicker.php | 6 +++--- framework/Web/UI/WebControls/TSlider.php | 8 ++++---- framework/Web/UI/WebControls/TTabPanel.php | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'framework/Web/UI/WebControls') 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; } -- cgit v1.2.3