1 <?php
2 3 4 5 6 7 8 9 10 11
12 Yii::import('yiiwheels.widgets.formhelpers.WhDropDownInputWidget');
13
14 class WhLanguages extends WhDropDownInputWidget
15 {
16
17 public function init()
18 {
19
20 parent::init();
21 TbHtml::addCssClass('bfh-languages', $this->htmlOptions);
22
23 if(!isset($this->htmlOptions['data-timezone'])) {
24 $this->htmlOptions['data-timezone'] = TbArray::popValue('data-value', $this->htmlOptions);
25 }
26 unset($this->htmlOptions['data-name'], $this->htmlOptions['data-value']);
27 }
28
29 public function run()
30 {
31 if(!$this->readOnly) {
32 echo $this->dropDownList();
33 } else
34 {
35 echo CHtml::tag('span', $this->htmlOptions, '');
36 }
37
38 $this->registerPlugin('bfhtimezones');
39 }
40 }