Source
* string $data['eventid'] (optional) Mandatory for "Update problem", "Mark as cause"
<?php
/*
** 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/>.
**/
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,
'csrf_token' => CCsrfTokenHelper::get('dashboard')
]
];
}
/**
* Prepare data for item history menu popup.
*
* @param string $itemid
*
* @return array
*/
public static function getHistory($itemid) {
return [
'type' => 'history',
'data' => [
'itemid' => $itemid
]
];
}
/**