Source
$header_checkbox = (new CCheckBox('all_hosts'))->onClick("checkAll('".$form->getName()."', 'all_hosts', 'hostids');");
<?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
*/
$this->addJsFile('class.tagfilteritem.js');
$this->addJsFile('items.js');
$this->addJsFile('multilineinput.js');
$this->includeJsFile('configuration.host.list.js.php');
if ($data['uncheck']) {
uncheckTableRows('hosts');
}
$html_page = (new CHtmlPage())
->setTitle(_('Hosts'))
->setDocUrl(CDocHelper::getUrl(CDocHelper::DATA_COLLECTION_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", '.
CSRF_TOKEN_NAME.': "'.CCsrfTokenHelper::get('import').
'"}, {
dialogueid: "popup_import",
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())