Source
(new CTextBox('base_dn', $data['base_dn'], false, DB::getFieldLength('userdirectory', 'base_dn')))
<?php declare(strict_types = 1);
/*
** 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_action = (new CUrl('zabbix.php'))
->setArgument('action', 'popup.ldap.check')
->getUrl();
$form = (new CForm('post', $form_action))
->addItem(getMessages())
->addItem((new CInput('submit'))->addStyle('display: none;'))
->addVar('row_index', $data['row_index'])
->addVar('userdirectoryid', $data['userdirectoryid'] ?? null)
->addItem((new CFormGrid())
->addItem([
(new CLabel(_('Name'), 'name'))->setAsteriskMark(),
new CFormField(
(new CTextBox('name', $data['name'], false, DB::getFieldLength('userdirectory', 'name')))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAriaRequired()
->setAttribute('autofocus', 'autofocus')
)
])
->addItem([
(new CLabel(_('Host'), 'host'))->setAsteriskMark(),
new CFormField(
(new CTextBox('host', $data['host'], false, DB::getFieldLength('userdirectory', 'host')))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAriaRequired()
)
])
->addItem([
(new CLabel(_('Port'), 'port'))->setAsteriskMark(),
new CFormField(
(new CNumericBox('port', $data['port'], 5))
->setWidth(ZBX_TEXTAREA_NUMERIC_STANDARD_WIDTH)
->setAriaRequired()
)
])
->addItem([
(new CLabel(_('Base DN'), 'base_dn'))->setAsteriskMark(),