23 'fieldType' => array(
'DATE',
'VARCHAR'),
24 'params' => $this->params,
25 'paramsLabels' => array(
40 if ($value ==
'0000-00-00') {
55 return $model->getAttribute($field->varname);
67 if (!isset($htmlOptions[
'size'])) {
68 $htmlOptions[
'size'] = 60;
70 if (!isset($htmlOptions[
'maxlength'])) {
71 $htmlOptions[
'maxlength'] = (($field->field_size) ? $field->field_size : 10);
73 if (!isset($htmlOptions[
'id'])) {
74 $htmlOptions[
'id'] = get_class($model).
'_'.$field->varname;
77 $id = $htmlOptions[
'id'];
78 $options[
'dateFormat'] =
'yy-mm-dd';
79 $options = CJavaScript::encode($options);
81 $basePath = Yii::getPathOfAlias(
'user.views.asset');
82 $baseUrl = Yii::app()->getAssetManager()->publish($basePath);
83 $cs = Yii::app()->getClientScript();
84 $cs->registerCssFile(
$baseUrl.
'/css/'.$this->params[
'ui-theme'].
'/jquery-ui.css');
85 $cs->registerScriptFile(
$baseUrl.
'/js/jquery-ui.min.js');
87 $language = $this->params[
'language'];
88 if ($language !=
'en') {
89 $js =
"jQuery('#{$id}').datepicker(jQuery.extend({showMonthAfterYear:false}, jQuery.datepicker.regional['{$language}'], {$options}));";
90 $cs->registerScriptFile(
$baseUrl.
'/js/jquery-ui-i18n.min.js');
92 $js =
"jQuery('#{$id}').datepicker({$options});";
95 $cs->registerScript(
'ProfileFieldController'.
'#'.$id, $js);
97 return CHtml::activeTextField($model, $field->varname, $htmlOptions);