<?php declare(strict_types = 0);
$inline_js = getPagePostJs().$this->readJsFile('popup.condition.edit.js.php');
->setId('popup.condition')
->setName('popup.condition')
->setAttribute('aria-labelledby', CHtmlPage::PAGE_TITLE_ID)
->addVar('action', $data['action'])
->addVar('row_index', $data['row_index'] ? $data['row_index'] : 0)
->addVar('type', $data['type']);
if ($data['type'] == ZBX_POPUP_CONDITION_TYPE_ACTION) {
$form->addVar('source', $data['eventsource']);
elseif ($data['type'] == ZBX_POPUP_CONDITION_TYPE_ACTION_OPERATION) {
$form->addVar('source', $data['source']);
$condition_type = (int) $data['last_type'];
$form_grid = (new CFormGrid());
case ZBX_POPUP_CONDITION_TYPE_ACTION:
require_once __DIR__ .'/../../include/actions.inc.php';
$operators_by_condition = [];
foreach ($data['allowed_conditions'] as $type) {
if ($data['eventsource'] == EVENT_SOURCE_SERVICE && $type == ZBX_CONDITION_TYPE_EVENT_TAG) {
$action_conditions[$type] = _('Service tag name');
elseif ($data['eventsource'] == EVENT_SOURCE_SERVICE && $type == ZBX_CONDITION_TYPE_EVENT_TAG_VALUE) {
$action_conditions[$type] = _('Service tag value');
$action_conditions[$type] = condition_type2str($type);
foreach (get_operators_by_conditiontype($type) as $value) {
$operators_by_condition[$type][$value] = condition_operator2str($value);