Source
* TRIGGER_SEVERITY_WARNING, TRIGGER_SEVERITY_AVERAGE, TRIGGER_SEVERITY_HIGH,
<?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.
**/
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;
}
}