Source
$data['warning'] = makeMessageBox(ZBX_STYLE_MSG_WARNING, [['message' => $data['warning']]]);
<?php declare(strict_types = 0);
/*
** Zabbix
** Copyright (C) 2001-2022 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
*/
$data['form_name'] = 'host-form';
$popup_url = (new CUrl('zabbix.php'))
->setArgument('action', 'host.edit');
if ($data['hostid'] == 0) {
if (array_key_exists('groupids', $data) && $data['groupids']) {
$popup_url->setArgument('groupids', $data['groupids']);
}
elseif ($data['clone_hostid'] !== null) {
$popup_url->setArgument('hostid', $data['clone_hostid']);
if ($data['full_clone'] === 1) {
$popup_url->setArgument('full_clone', 1);
}
else {
$popup_url->setArgument('clone', 1);
}
}
$buttons = [
[
'title' => _('Add'),
'class' => '',
'keepOpen' => true,
'isSubmit' => true,
'action' => 'host_edit_popup.submit();'
]
];
}
else {
$popup_url->setArgument('hostid', $data['hostid']);
$buttons = [
[
'title' => _('Update'),
'class' => '',
'keepOpen' => true,