Source
? new CSpan(makeWarningIcon(_('Timeouts are disabled because the proxy and server versions do not match.')))
<?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
*/
$form = (new CForm('post'))
->addItem((new CVar(CCsrfTokenHelper::CSRF_TOKEN_NAME, CCsrfTokenHelper::get('proxy')))->removeId())
->setId('proxy-form')
->setName('proxy_form')
->addStyle('display: none;')
->addItem(getMessages());
// Enable form submitting on Enter.
$form->addItem((new CSubmitButton())->addClass(ZBX_STYLE_FORM_SUBMIT_HIDDEN));
// Proxy tab.
$interface = (new CTable())
->setHeader([_('Address'), _('Port')])
->addRow([
(new CTextBox('address', $data['form']['address'], false, DB::getFieldLength('proxy', 'address')))
->setWidth(336),
(new CTextBox('port', $data['form']['port'], false, DB::getFieldLength('proxy', 'port')))
->setWidth(ZBX_TEXTAREA_INTERFACE_PORT_WIDTH)
->setAriaRequired()
]);
$proxy_tab = (new CFormGrid())
->addItem([
(new CLabel(_('Proxy name'), 'name'))->setAsteriskMark(),
new CFormField(
(new CTextBox('name', $data['form']['name'], false, DB::getFieldLength('proxy', 'name')))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAriaRequired()
)
])
->addItem([
new CLabel(_('Proxy mode'), 'operating_mode'),
new CFormField(
(new CRadioButtonList('operating_mode', $data['form']['operating_mode']))
->addValue(_('Active'), PROXY_OPERATING_MODE_ACTIVE)
->addValue(_('Passive'), PROXY_OPERATING_MODE_PASSIVE)