Source
if (array_key_exists($options['srcfld3'], $trigger) && array_key_exists($trigger[$options['srcfld3']], $trigger)) {
<?php
/*
** Zabbix
** Copyright (C) 2001-2025 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
*/
$output = [
'header' => $data['title'],
'body' => '',
'controls' => '',
'script_inline' => '',
'buttons' => null
];
$options = $data['options'];
$controls = [];
$form = null;
$script_inline = '';
// Construct table header.
$header_form = ($data['popup_type'] === 'help_items') ? (new CForm())->cleanItems() : new CDiv();
$header_form->setId('generic-popup-form');
// Make 'empty' button.
if ($data['popup_type'] === 'triggers' && !array_key_exists('noempty', $options)) {
$value1 = (strpos($options['dstfld1'], 'id') !== false) ? 0 : '';
$value2 = (strpos($options['dstfld2'], 'id') !== false) ? 0 : '';
$value3 = (strpos($options['dstfld3'], 'id') !== false) ? 0 : '';
$empty_btn = (new CButton('empty', _('Empty')))
->addStyle('float: right; margin-left: 5px;')
->onClick('popup_generic.setEmpty(event, '.json_encode([
$options['dstfld1'] => $value1,
$options['dstfld2'] => $value2,
$options['dstfld3'], $value3
]).')');
}
else {
$empty_btn = null;
}
// Add host group multiselect control.
if (array_key_exists('groups', $data['filter'])) {