16 Yii::import(
'booster.widgets.TbBaseInputWidget');
75 public function run() {
77 list($name, $id) = $this->resolveNameID();
81 $this->htmlOptions[
'class'] = empty($this->htmlOptions[
'class'])
83 :
'no-user-select ' . $this->htmlOptions[
'class'];
86 if (empty($this->htmlOptions[
'id'])) {
87 $this->htmlOptions[
'id'] = $this->id;
91 $this->wrapperHtmlOptions = $this->
injectClass($this->wrapperHtmlOptions,
'bootstrap-timepicker');
94 $this->wrapperHtmlOptions = $this->
injectClass($this->wrapperHtmlOptions,
'input-group');
97 echo CHtml::openTag(
'div', $this->wrapperHtmlOptions);
98 if ($this->hasModel()) {
100 echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions);
102 echo CHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
105 echo CHtml::textField($name, $this->
value, $this->htmlOptions);
107 if (!$this->noAppend)
109 echo CHtml::closeTag(
'div');
123 $options = !empty($this->options) ? CJavaScript::encode($this->options) :
'';
127 echo
"jQuery('#{$id}').timepicker({$options})";
128 foreach ($this->events as $event => $handler) {
129 echo
".on('{$event}', " . CJavaScript::encode($handler) .
")";
132 Yii::app()->getClientScript()->registerScript(__CLASS__ .
'#' . $id, ob_get_clean() .
';');
143 if (array_key_exists(
'class', $valueset) and is_string($valueset[
'class'])) {
144 $valueset[
'class'] = implode(
155 $valueset[
'class'] = $className;
163 echo CHtml::tag(
'span', array(
'class' =>
'input-group-addon'), CHtml::tag(
'i', array(
'class' =>
'glyphicon glyphicon-time'),
''));