1 <?php
2 3 4 5 6 7 8 9 10 11
12 Yii::import('yiiwheels.widgets.formhelpers.WhDropDownInputWidget');
13
14 class WhTimezones extends WhDropDownInputWidget
15 {
16
17 18 19 20
21 public $country;
22
23 public function init()
24 {
25 if (empty($this->country) && !isset($this->pluginOptions['country'])) {
26 throw new CException('"$country" cannot be empty.');
27 }
28
29 $this->pluginOptions['country'] = TbArray::getValue('country', $this->pluginOptions, $this->country);
30
31 parent::init();
32
33 TbHtml::addCssClass('bfh-timezones', $this->htmlOptions);
34
35 unset($this->htmlOptions['data-name']);
36 }
37
38 public function run()
39 {
40 if(!$this->readOnly) {
41 echo $this->dropDownList();
42 } else
43 {
44 echo CHtml::tag('span', $this->htmlOptions, '');
45 }
46
47 $this->registerPlugin('bfhcountries');
48 }
49 }