Source
* TRIGGER_SEVERITY_WARNING, TRIGGER_SEVERITY_AVERAGE, TRIGGER_SEVERITY_HIGH,
<?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/>.
**/
function sysmap_element_types($type = null) {
$types = [
SYSMAP_ELEMENT_TYPE_HOST => _('Host'),
SYSMAP_ELEMENT_TYPE_HOST_GROUP => _('Host group'),
SYSMAP_ELEMENT_TYPE_TRIGGER => _('Trigger'),
SYSMAP_ELEMENT_TYPE_MAP => _('Map'),
SYSMAP_ELEMENT_TYPE_IMAGE => _('Image')
];
if (is_null($type)) {
natsort($types);
return $types;
}
elseif (isset($types[$type])) {
return $types[$type];
}
else {
return _('Unknown');
}
}
function sysmapElementLabel($label = null) {
$labels = [
MAP_LABEL_TYPE_LABEL => _('Label'),
MAP_LABEL_TYPE_IP => _('IP address'),
MAP_LABEL_TYPE_NAME => _('Element name'),
MAP_LABEL_TYPE_STATUS => _('Status only'),
MAP_LABEL_TYPE_NOTHING => _('Nothing'),
MAP_LABEL_TYPE_CUSTOM => _('Custom label')
];
if (is_null($label)) {
return $labels;
}
elseif (isset($labels[$label])) {
return $labels[$label];
}
else {
return false;
}
}
/**
* Get actions (data for popup menu) for map elements.
*
* @param array $sysmap
* @param array $sysmap['selements']