Source
* @param string $selement[elementtype] Map element type (host, map, trigger, host group, image).
<?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.
**/
class CMenuPopupHelper {
/**
* Prepare data for dashboard popup menu.
*
* @param string|null $dashboardid
* @param bool $editable
* @param bool $has_related_reports
* @param bool $can_edit_dashboards
* @param bool $can_view_reports
* @param bool $can_create_reports
*
* @return array
*/
public static function getDashboard(?string $dashboardid, bool $editable, bool $has_related_reports,
bool $can_edit_dashboards, bool $can_view_reports, bool $can_create_reports): array {
return [
'type' => 'dashboard',
'data' => [
'dashboardid' => $dashboardid,
'editable' => $editable,
'has_related_reports' => $has_related_reports,
'can_edit_dashboards' => $can_edit_dashboards,
'can_view_reports' => $can_view_reports,
'can_create_reports' => $can_create_reports
]
];
}
/**
* Prepare data for item history menu popup.
*
* @param string $itemid
*
* @return array
*/
public static function getHistory($itemid) {
return [
'type' => 'history',
'data' => [
'itemid' => $itemid
]