Source
function makeTags(array $list, bool $html = true, string $key = 'eventid', int $list_tag_count = ZBX_TAG_COUNT_DEFAULT,
<?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.
**/
/**
* Returns the names of supported event sources.
*
* If the $source parameter is passed, returns the name of the specific source, otherwise - returns an array of all
* supported sources.
*
* @param int $source
*
* @return array|string
*/
function eventSource($source = null) {
$sources = [
EVENT_SOURCE_TRIGGERS => _('trigger'),
EVENT_SOURCE_DISCOVERY => _('discovery'),
EVENT_SOURCE_AUTOREGISTRATION => _('autoregistration'),
EVENT_SOURCE_INTERNAL => _x('internal', 'event source'),
EVENT_SOURCE_SERVICE => _('service')
];
if ($source === null) {
return $sources;
}
return array_key_exists($source, $sources) ? $sources[$source] : _('Unknown');
}
/**
* Returns the names of supported event objects.
*
* If the $source parameter is passed, returns the name of the specific object, otherwise - returns an array of all
* supported objects.
*
* @param int $object
*
* @return array|string
*/
function eventObject($object = null) {
$objects = [
EVENT_OBJECT_TRIGGER => _('trigger'),
EVENT_OBJECT_DHOST => _('discovered host'),
EVENT_OBJECT_DSERVICE => _('discovered service'),
EVENT_OBJECT_AUTOREGHOST => _('autoregistered host'),