if (in_array($data['eventsource'], [EVENT_SOURCE_TRIGGERS, EVENT_SOURCE_INTERNAL, EVENT_SOURCE_SERVICE])) {
<?php declare(strict_types = 0);
->addItem((new CVar(CSRF_TOKEN_NAME, CCsrfTokenHelper::get('action')))->removeId())
->addVar('actionid', $data['actionid'] ?: 0)
->addVar('eventsource', $data['eventsource'])
->addStyle('display: none;');
$form->addItem((new CSubmitButton())->addClass(ZBX_STYLE_FORM_SUBMIT_HIDDEN));
$action_tab = (new CFormGrid())
(new CLabel(_('Name'), 'name'))->setAsteriskMark(),
(new CTextBox('name', $data['action']['name'] ?: ''))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAttribute('autofocus', 'autofocus')
$condition_table = (new CTable())
->setId('conditionTable')
->setAttribute('style', 'width: 100%;')
->setHeader([_('Label'), _('Name'), _('Action')]);
$formula = (new CTextBox('formula', $data['formula'], false, DB::getFieldLength('actions', 'formula')))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAttribute('placeholder', 'A or (B and C) ...');
$condition_hidden_data = (new CCol([
(new CButtonLink(_('Remove')))
->addClass('js-remove-condition'),
->setAttribute('value', '#{conditiontype}')
->setName('conditions[#{row_index}][conditiontype]'),
->setAttribute('value', '#{operator}')