Source
foreach (CCorrelationHelper::getOperatorsByConditionType(ZBX_CORR_CONDITION_NEW_EVENT_HOSTGROUP) as $value) {
<?php declare(strict_types = 0);
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
/**
* @var CView $this
* @var array $data
*/
$inline_js = getPagePostJs().$this->readJsFile('correlation.condition.edit.js.php');
$form = (new CForm())
->setId('correlation-condition-form')
->setName('conditions')
->setAttribute('aria-labeledby', CHtmlPage::PAGE_TITLE_ID)
->addVar('conditiontype', $data['conditiontype'])
->addItem((new CInput('submit', null))->addStyle('display: none;'));
$condition_type = (int) $data['last_type'];
// Type select.
$form_grid = (new CFormGrid())
->addItem([
new CLabel(_('Type'), 'label-condition-type'),
new CFormField((new CSelect('conditiontype'))
->setFocusableElementId('label-condition-type')
->setValue($condition_type)
->setId('condition-type')
->addOptions(CSelect::createOptionsFromArray(CCorrelationHelper::getConditionTypes()))
)
]);
switch ($condition_type) {
// Old|New event tag form elements.
case ZBX_CORR_CONDITION_OLD_EVENT_TAG:
case ZBX_CORR_CONDITION_NEW_EVENT_TAG:
$operator = (new CRadioButtonList('', CONDITION_OPERATOR_EQUAL))
->setModern(true)
->addValue(CCorrelationHelper::getLabelByOperator(
CCorrelationHelper::getOperatorsByConditionType(ZBX_CORR_CONDITION_OLD_EVENT_TAG)[0]
), CCorrelationHelper::getOperatorsByConditionType(ZBX_CORR_CONDITION_OLD_EVENT_TAG)[0]);
$new_condition_tag = (new CTextAreaFlexible('tag'))
->setId('tag')
->setWidth(ZBX_TEXTAREA_MEDIUM_WIDTH);