Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
dropdown.php
1<?php
2
4
6
12{
13 const JS_EVENT_ON_CHANGE = 'onChange';
14 private $options = array();
15
21 public function __construct($key)
22 {
23 parent::__construct($key);
24 $options = $this->getDefaultOptions();
25 $this->setOptions($options);
26 $this->setLabel('Select: ');
27 $this->setDefaultValue('__');
28 }
29
30
36 public function printContent()
37 {
38 $this->includeFieldComponent('baseselect');
39 }
40
41
45 public function getDefaultOptions()
46 {
47 return array('__' => Loc::getMessage('REPORT_DROP_DOWN_DEFAULT_VALUE_TITLE'));
48 }
49
57 public function addOption($key, $value)
58 {
59 $this->options[$key] = $value;
60 return $this;
61 }
62
69 public function addOptions($options)
70 {
71 foreach ($options as $key => $value)
72 {
73 $this->options[$key] = $value;
74 }
75 }
79 public function getOptions()
80 {
81 return $this->options;
82 }
83
90 public function setOptions($options)
91 {
92 $this->options = $options;
93 }
94
95}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
includeFieldComponent($templateName, $params=array())
Definition base.php:530