addField( (new CWidgetFieldRadioButtonList('source_type', _('Source type'), [ Widget::SOURCETYPE_MAP => _('Map'), Widget::SOURCETYPE_FILTER => _('Map navigation tree') ])) ->setDefault(Widget::SOURCETYPE_MAP) ->setAction('ZABBIX.Dashboard.reloadWidgetProperties()') ); if (!array_key_exists('source_type', $this->values) || $this->values['source_type'] == Widget::SOURCETYPE_MAP) { $this->addField( (new CWidgetFieldMultiSelectMap('sysmapid', _('Map'))) ->setFlags(CWidgetField::FLAG_NOT_EMPTY | CWidgetField::FLAG_LABEL_ASTERISK) ->setMultiple(false) ); } else { $this->addField( (new CWidgetFieldWidgetSelect('filter_widget_reference', _('Filter'), self::WIDGET_NAV_TREE)) ->setFlags(CWidgetField::FLAG_NOT_EMPTY | CWidgetField::FLAG_LABEL_ASTERISK) ); } return $this; } }