Skip to content

Commit 107b3ca

Browse files
author
Antonio Ramirez
committed
Fixed typo issues and refactored to follow same library code patterns closes clevertech#82
1 parent 3db9c03 commit 107b3ca

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

components/Bootstrap.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -339,17 +339,14 @@ public function registerDatePicker($selector = null, $options = array())
339339
}
340340

341341
/**
342-
* Registers the Bootstrap timepicker plugin.
342+
* Register the Bootstrap timepicker plugin.
343343
* @param string $selector the CSS selector
344344
* @param array $options the plugin options
345345
* @see http://www.eyecon.ro/bootstrap-datepicker/
346-
* @since 0.10.0
346+
* @since 1.0.3
347347
*/
348-
public function registerTimepicker($selector = null, $options = array())
348+
public function registerTimePicker($selector = null, $options = array())
349349
{
350-
$cs = Yii::app()->getClientScript();
351-
$cs->registerCssFile($this->getAssetsUrl() . '/css/bootstrap-timepicker.css');
352-
$cs->registerScriptFile($this->getAssetsUrl() . '/js/bootstrap.timepicker.js', CClientScript::POS_HEAD);
353350
$this->registerPlugin(self::PLUGIN_TIMEPICKER, $selector, $options);
354351
}
355352

widgets/input/TbInput.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ public function run()
265265
case self::TYPE_TIMEPICKER:
266266
$this->timepickerField();
267267
break;
268-
default:
269268

270269
default:
271270
throw new CException(__CLASS__ . ': Failed to run widget! Type is invalid.');
@@ -545,7 +544,7 @@ abstract protected function dateRangeField();
545544
abstract protected function colorpickerField();
546545

547546
/**
548-
* Renders a datepicker field.
547+
* Renders a timepicker field.
549548
* @return string the rendered content
550549
* @abstract
551550
*/

widgets/input/TbInputHorizontal.php

+3
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ protected function dateRangeField()
404404
'callback' => isset($callback) ? $callback : array(),
405405
'htmlOptions' => $this->htmlOptions,
406406
));
407+
echo $this->getAppend();
407408
echo $this->getError() . $this->getHint();
408409
echo '</div>';
409410
}
@@ -429,6 +430,7 @@ protected function timepickerField()
429430

430431
echo $this->getLabel();
431432
echo '<div class="controls">';
433+
echo $this->getPrepend();
432434
$this->widget('bootstrap.widgets.TbBootTimepicker', array(
433435
'model'=>$this->model,
434436
'attribute'=>$this->attribute,
@@ -437,6 +439,7 @@ protected function timepickerField()
437439
'htmlOptions'=>$this->htmlOptions,
438440
'form'=>$this->form
439441
));
442+
echo $this->getAppend();
440443
echo $this->getError().$this->getHint();
441444
echo '</div>';
442445
}

widgets/input/TbInputVertical.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ protected function dateRangeField()
353353
}
354354

355355
/**
356-
* Renders a datepicker field.
356+
* Renders a timepicker field.
357357
* @return string the rendered content
358358
* @author Sergii Gamaiunov <[email protected]>
359359
*/
@@ -372,14 +372,16 @@ protected function timepickerField()
372372
}
373373

374374
echo $this->getLabel();
375-
$this->widget('bootstrap.widgets.TbBootTimepicker', array(
375+
echo $this->getPrepend();
376+
$this->widget('bootstrap.widgets.TbTimePicker', array(
376377
'model'=>$this->model,
377378
'attribute'=>$this->attribute,
378379
'options'=>isset($options) ? $options : array(),
379380
'events'=>isset($events) ? $events : array(),
380381
'htmlOptions'=>$this->htmlOptions,
381382
'form'=>$this->form
382383
));
384+
echo $this->getAppend();
383385
echo $this->getError().$this->getHint();
384386
}
385387

0 commit comments

Comments
 (0)