Source
xxxxxxxxxx
->setControls((new CTag('nav', true, $header['right']))->setAttribute('aria-label', _('Content controls')));
<?php
/*
** Zabbix
** Copyright (C) 2001-2023 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
*/
$this->includeJsFile('monitoring.history.js.php');
$web_layout_mode = CViewHelper::loadLayoutMode();
$html_page = (new CHtmlPage())->setWebLayoutMode($web_layout_mode);
$header = [
'left' => _n('%1$s item', '%1$s items', count($data['items'])),
'right' => (new CForm('get'))
->setName('filter_view_as')
->addVar('itemids', $data['itemids'])
];
$header_row = [];
$same_host = true;
$items_numeric = true;
$host_name = '';
if ($data['items']) {
$first_item = reset($data['items']);
$host_name = $first_item['hosts'][0]['name'];
foreach ($data['items'] as $item) {
$same_host = ($same_host && $host_name === $item['hosts'][0]['name']);
$items_numeric = ($items_numeric && array_key_exists($item['value_type'], $data['iv_numeric']));
}
}
if ((count($data['items']) == 1 || $same_host) && $data['itemids']) {
$header['left'] = $host_name.NAME_DELIMITER.(count($data['items']) == 1 ? $item['name'] : $header['left']);
$header_row[] = $header['left'];
}
else {
$header_row[] = $header['left'];
}
if (hasRequest('filter_task')) {
$header['right']->addVar('filter_task', $data['filter_task']);
}