Source
xxxxxxxxxx
<?php declare(strict_types = 0);
/*
** 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 Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/**
* @var CView $this
* @var array $data
*/
$form = (new CForm('post'))
->addItem((new CVar(CSRF_TOKEN_NAME, CCsrfTokenHelper::get('proxygroup')))->removeId())
->setId('proxy-group-form')
->setName('proxy_group_form')
->addItem(getMessages());
// Enable form submitting on Enter.
$form->addItem((new CSubmitButton())->addClass(ZBX_STYLE_FORM_SUBMIT_HIDDEN));
if ($data['proxy_groupid'] !== null) {
$form->addVar('proxy_groupid', $data['proxy_groupid']);
}
$form_grid = (new CFormGrid())
->addItem([
(new CLabel(_('Name'), 'name'))->setAsteriskMark(),
new CFormField(
(new CTextBox('name', $data['form']['name'], false, DB::getFieldLength('proxy_group', 'name')))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAriaRequired()
->setAttribute('autofocus', 'autofocus')
)
])
->addItem([
(new CLabel(_('Failover period'), 'failover_delay'))->setAsteriskMark(),
new CFormField(
(new CTextBox('failover_delay', $data['form']['failover_delay'], false,
DB::getFieldLength('proxy_group', 'failover_delay')
))->setWidth(ZBX_TEXTAREA_SMALL_WIDTH)
)
])
->addItem([
(new CLabel(_('Minimum number of proxies'), 'min_online'))->setAsteriskMark(),
new CFormField(
(new CTextBox('min_online', $data['form']['min_online'], false,
DB::getFieldLength('proxy_group', 'min_online')
))->setWidth(ZBX_TEXTAREA_SMALL_WIDTH)
)
])
->addItem([
new CLabel(_('Description'), 'description'),
new CFormField(