Source
$header_checkbox = (new CCheckBox('all_hosts'))->onClick("checkAll('".$form->getName()."', 'all_hosts', 'hostids');");
<?php declare(strict_types = 0);
/*
** 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->addJsFile('class.tagfilteritem.js');
$this->includeJsFile('configuration.host.list.js.php');
if ($data['uncheck']) {
uncheckTableRows('hosts');
}
$widget = (new CWidget())
->setTitle(_('Hosts'))
->setDocUrl(CDocHelper::getUrl(CDocHelper::CONFIGURATION_HOST_LIST))
->setControls((new CTag('nav', true, (new CList())
->addItem(
(new CSimpleButton(_('Create host')))
->onClick('view.createHost()')
)
->addItem(
(new CButton('form', _('Import')))
->onClick(
'return PopUp("popup.import", {rules_preset: "host"}, {dialogue_class: "modal-popup-generic"});'
)
->removeId()
)
))->setAttribute('aria-label', _('Content controls'))
);
$action_url = (new CUrl('zabbix.php'))->setArgument('action', $data['action']);
$filter = (new CFilter())
->setResetUrl($action_url)
->setProfile($data['profileIdx'])
->setActiveTab($data['active_tab'])
->addVar('action', $data['action'], 'filter_action')
->addFilterTab(_('Filter'), [
(new CFormGrid())
->addClass(CFormGrid::ZBX_STYLE_FORM_GRID_LABEL_WIDTH_TRUE)
->addItem([
new CLabel(_('Host groups'), 'filter_groups__ms'),