Source
? (new CMenuItem(_('Triggers top 100')))->setUrl(new CUrl('toptriggers.php'), 'toptriggers.php')
<?php declare(strict_types = 1);
/*
** 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.
**/
class CMenuHelper {
/**
* Get main menu element.
*
* @return CMenu
*/
public static function getMainMenu(): CMenu {
$menu = new CMenu();
$submenu_monitoring = [
CWebUser::checkAccess(CRoleHelper::UI_MONITORING_DASHBOARD)
? (new CMenuItem(_('Dashboard')))
->setAction('dashboard.view')
->setAliases(['dashboard.list'])
: null,
CWebUser::checkAccess(CRoleHelper::UI_MONITORING_PROBLEMS)
? (new CMenuItem(_('Problems')))
->setAction('problem.view')
->setAliases(['tr_events.php'])
: null,
CWebUser::checkAccess(CRoleHelper::UI_MONITORING_HOSTS)
? (new CMenuItem(_('Hosts')))
->setAction('host.view')
->setAliases([
'web.view', 'charts.view', 'chart2.php', 'chart3.php', 'chart6.php', 'chart7.php',
'httpdetails.php', 'host.dashboard.view'
])
: null,
CWebUser::checkAccess(CRoleHelper::UI_MONITORING_LATEST_DATA)
? (new CMenuItem(_('Latest data')))
->setAction('latest.view')
->setAliases(['history.php', 'chart.php'])
: null,
CWebUser::checkAccess(CRoleHelper::UI_MONITORING_MAPS)
? (new CMenuItem(_('Maps')))
->setAction('map.view')
->setAliases(['image.php', 'sysmaps.php', 'sysmap.php', 'map.php'])
: null,
CWebUser::checkAccess(CRoleHelper::UI_MONITORING_DISCOVERY)
? (new CMenuItem(_('Discovery')))->setAction('discovery.view')
: null