setId($this->getId().'_button'); $this->dropdown_value = $value; $this->dropdown_items = $items; $this->addClass(ZBX_STYLE_BTN_ALT); $this->addClass(ZBX_STYLE_BTN_TOGGLE); } public function toString($destroy = true) { $this->setMenuPopup([ 'type' => 'dropdown', 'data' => [ 'items' => $this->dropdown_items, 'toggle_class' => ZBX_STYLE_BTN_TOGGLE ] ]); return (new CDiv()) ->addClass(self::ZBX_STYLE_CLASS) ->setId($this->getId().'_wrap') ->addItem(new CObject(parent::toString($destroy))) ->addItem( (new CInput('hidden', $this->getAttribute('name'), $this->dropdown_value)) ->addClass(self::ZBX_STYLE_BTN_VALUE) ) ->toString(true); } }