summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TDatePicker.php
diff options
context:
space:
mode:
authorxue <>2006-02-18 07:24:51 +0000
committerxue <>2006-02-18 07:24:51 +0000
commit145c4aef09e278d29bfd8e9858e114ca097e5901 (patch)
treef125683e12badb170f9b5c435a811fd4f8eb3942 /framework/Web/UI/WebControls/TDatePicker.php
parent64a5d4b6d3adaeab325d0e72d6c6c7624d861807 (diff)
client script reorganization.
Diffstat (limited to 'framework/Web/UI/WebControls/TDatePicker.php')
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php
index fd280938..a70e25b3 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -228,7 +228,8 @@ class TDatePicker extends TTextBox
{
$options['Format'] = $this->getDateFormat();
$options['FirstDayOfWeek'] = $this->getFirstDayOfWeek();
- $options['ClassName'] = $this->getCssClass();
+ if(($cssClass=$this->getCssClass())!=='')
+ $options['ClassName'] = $cssClass;
$options['FromYear'] = $this->getFromYear();
$options['UpToYear'] = $this->getUpToYear();
if($this->getMode()!=='Basic')
@@ -252,10 +253,8 @@ class TDatePicker extends TTextBox
Prado::using('System.I18N.core.DateTimeFormatInfo');
$info = Prado::createComponent('System.I18N.core.CultureInfo', $culture);
$date = $info->getDateTimeFormat();
- $serializer = new TJavascriptSerializer($date->getMonthNames());
- $options['MonthNames'] = $serializer->toList();
- $serializer = new TJavascriptSerializer($date->getAbbreviatedDayNames());
- $options['ShortWeekDayNames'] = $serializer->toList();
+ $options['MonthNames'] = TJavaScript::encode($date->getMonthNames(),false);
+ $options['ShortWeekDayNames'] = TJavaScript::encode($date->getAbbreviatedDayNames(),false);
return $options;
}
@@ -367,9 +366,8 @@ class TDatePicker extends TTextBox
if($this->getShowCalendar())
{
$scripts = $this->getPage()->getClientScript();
- $scripts->registerClientScript("datepicker");
- $serializer = new TJavascriptSerializer($this->getDatePickerOptions());
- $options = $serializer->toJavascript();
+ $scripts->registerPradoScript("datepicker");
+ $options = TJavaScript::encode($this->getDatePickerOptions());
$id = $this->getClientID();
$code = "Event.OnLoad(function(){ new Prado.WebUI.TDatePicker('$id', $options); });";
$scripts->registerEndScript("prado:$id", $code);