Source
<?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
*/
$form = (new CForm('post'))
->setId('proxy-form')
->setName('proxy_form')
->addStyle('display: none;')
->addItem(getMessages());
// Enable form submitting on Enter.
$form->addItem((new CInput('submit'))->addStyle('display: none;'));
// Proxy tab.
$interface = (new CTable())
->setHeader([_('IP address'), _('DNS name'), _('Connect to'), _('Port')])
->addRow([
(new CTextBox('ip', $data['form']['interface']['ip'], false, DB::getFieldLength('interface', 'ip')))
->setWidth(ZBX_TEXTAREA_INTERFACE_IP_WIDTH),
(new CTextBox('dns', $data['form']['interface']['dns'], false, DB::getFieldLength('interface', 'dns')))
->setWidth(ZBX_TEXTAREA_INTERFACE_DNS_WIDTH),
(new CRadioButtonList('useip', (int) $data['form']['interface']['useip']))
->addValue('IP', INTERFACE_USE_IP)
->addValue('DNS', INTERFACE_USE_DNS)
->setModern(true),
(new CTextBox('port', $data['form']['interface']['port'], false, DB::getFieldLength('interface', 'port')))
->setWidth(ZBX_TEXTAREA_INTERFACE_PORT_WIDTH)
->setAriaRequired()
]);
$proxy_tab = (new CFormGrid())
->addItem([
(new CLabel(_('Proxy name'), 'host'))->setAsteriskMark(),
new CFormField(
(new CTextBox('host', $data['form']['host'], false, DB::getFieldLength('hosts', 'host')))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAriaRequired()
)
])
->addItem([