Source
(new CLabel([new CSpan(), '#{name}'], 'uniqueness_criteria_#{dcheckid}'))->addClass(ZBX_STYLE_WORDWRAP)
<?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
*/
// Create form.
$form = (new CForm())
->addItem((new CVar(CSRF_TOKEN_NAME, CCsrfTokenHelper::get('discovery')))->removeId())
->setId('discoveryForm')
->addItem((new CSubmitButton())->addClass(ZBX_STYLE_FORM_SUBMIT_HIDDEN))
->addStyle('display: none;');
if ($this->data['drule']['druleid'] !== null) {
$form->addVar('druleid', $this->data['drule']['druleid']);
}
// Create form grid.
$form_grid = (new CFormGrid())
->addItem([
(new CLabel(_('Name'), 'name'))->setAsteriskMark(),
new CFormField(
(new CTextBox('name', $this->data['drule']['name']))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAriaRequired()
->setAttribute('autofocus', 'autofocus')
)
])
->addItem([
new CLabel(_('Discovery by'), 'discovery_by'),
new CFormField(
(new CRadioButtonList('discovery_by', $data['discovery_by']))
->addValue(_('Server'), ZBX_DISCOVERY_BY_SERVER)
->addValue(_('Proxy'), ZBX_DISCOVERY_BY_PROXY)
->setModern()
)
])
->addItem(
(new CFormField(
(new CMultiSelect([
'name' => 'proxyid',
'object_name' => 'proxies',
'multiple' => false,
'data' => $data['ms_proxy'],
'popup' => [
'parameters' => [
'srctbl' => 'proxies',
'srcfld1' => 'proxyid',