(new CTextBox('visiblename', $data['host']['visiblename'], $host_is_discovered, DB::getFieldLength('hosts', 'name')))
<?php declare(strict_types = 0);
$this->includeJsFile('configuration.host.edit.html.js.php');
$host_is_discovered = ($data['host']['flags'] == ZBX_FLAG_DISCOVERY_CREATED);
$host_form = (new CForm())
->addItem((new CVar(CSRF_TOKEN_NAME, CCsrfTokenHelper::get('host')))->removeId())
->setId($data['form_name'])
->setName($data['form_name'])
->setAction((new CUrl('zabbix.php'))
->setArgument('action', $data['form_action'])
->addVar('hostid', $data['hostid'])
->addVar('clone_hostid', $data['clone_hostid'])
->addVar('clone', $data['clone'])
->addItem((new CSubmitButton())->addClass(ZBX_STYLE_FORM_SUBMIT_HIDDEN));
if ($host_is_discovered) {
if ($data['host']['discoveryRule']) {
if ($data['is_discovery_rule_editable']) {
$discovery_rule = (new CLink($data['host']['discoveryRule']['name'],
(new CUrl('host_prototypes.php'))
->setArgument('form', 'update')
->setArgument('parent_discoveryid', $data['host']['discoveryRule']['itemid'])
->setArgument('hostid', $data['host']['hostDiscovery']['parent_hostid'])
->setArgument('context', 'host')
))->setAttribute('target', '_blank');
$discovery_rule = new CSpan($data['host']['discoveryRule']['name']);
$discovery_rule = (new CSpan(_('Inaccessible discovery rule')))->addClass(ZBX_STYLE_GREY);
$discovered_by = [new CLabel(_('Discovered by')), new CFormField($discovery_rule)];