Source
* @param int $host_interfaces[]['details']['community'] Interface community for SNMP non version 3 interface.
<?php
/*
** Zabbix
** 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 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 italic($str) {
if (is_array($str)) {
foreach ($str as $key => $val) {
if (is_string($val)) {
$em = new CTag('em', true);
$em->addItem($val);
$str[$key] = $em;
}
}
}
elseif (is_string($str)) {
$em = new CTag('em', true, '');
$em->addItem($str);
$str = $em;
}
return $str;
}
function bold($str) {
if (is_array($str)) {
foreach ($str as $key => $val) {
if (is_string($val)) {
$str[$key] = new CTag('b', true, $val);
}
}
return $str;
}
return new CTag('b', true, $str);
}
function make_decoration($haystack, $needle, $class = null) {
$result = $haystack;
$tmpHaystack = mb_strtolower($haystack);
$tmpNeedle = mb_strtolower($needle);
$pos = mb_strpos($tmpHaystack, $tmpNeedle);
if ($pos !== false) {
$start = mb_substr($haystack, 0, $pos);
$end = mb_substr($haystack, $pos + mb_strlen($needle));