Source
if ($template['host'] !== $template['name'] && strpos($template['host'], $data['search']) !== false) {
<?php
/*
** 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
*/
$this->includeJsFile('search.js.php');
$widgets = [];
$table = (new CTableInfo())
->setHeader((new CRowHeader())
->addItem(new CColHeader(_('Host')))
->addItem(new CColHeader(_('IP')))
->addItem(new CColHeader(_('DNS')))
->addItem((new CColHeader(_('Monitoring')))
->setColSpan($data['hosts'] ? 5 : 1)
->addClass(ZBX_STYLE_TABLE_LEFT_BORDER)
)
->addItem((new CColHeader(_('Configuration')))
->setColSpan($data['hosts'] ? 5 : 1)
->addClass(ZBX_STYLE_TABLE_LEFT_BORDER)
)
)
->removeId();
foreach ($data['hosts'] as $hostid => $host) {
$interface = reset($host['interfaces']);
$visible_name = make_decoration($host['name'], $data['search']);
$name_link = ($host['editable'] && $data['allowed_ui_conf_hosts'])
? (new CLink($visible_name, (new CUrl('zabbix.php'))
->setArgument('action', 'host.edit')
->setArgument('hostid', $hostid)
))
->setAttribute('data-hostid', $host['hostid'])
->onClick('view.editHost(event, this.dataset.hostid);')
: new CSpan($visible_name);
if ($host['status'] == HOST_STATUS_NOT_MONITORED) {
$name_link
->addClass(ZBX_STYLE_LINK_ALT)