Source
if (array_key_exists('units', $cell_data['parts']) && $cell_data['units_pos'] == WIDGET_ITEM_POS_BEFORE) {
<?php declare(strict_types = 0);
/*
** 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.
**/
/**
* @var CView $this
* @var array $data
*/
if ($data['error'] !== '') {
$body = (new CTableInfo())->setNoDataMessage($data['error']);
}
else {
$classes_vertical = [
WIDGET_ITEM_POS_TOP => 'top',
WIDGET_ITEM_POS_MIDDLE => 'middle',
WIDGET_ITEM_POS_BOTTOM => 'bottom'
];
$classes_horizontal = [
WIDGET_ITEM_POS_LEFT => 'left',
WIDGET_ITEM_POS_CENTER => 'center',
WIDGET_ITEM_POS_RIGHT => 'right'
];
$rows = [];
foreach ($classes_vertical as $row_key => $row_class) {
$cols = [];
foreach ($classes_horizontal as $column_key => $column_class) {
if (!array_key_exists($row_key, $data['cells'])
|| !array_key_exists($column_key, $data['cells'][$row_key])) {
continue;
}
$div = new CDiv();
$cell = $data['cells'][$row_key][$column_key];
$cell_type = array_keys($cell)[0];
$cell_data = array_values($cell)[0];
$div->addClass($row_class);
$div->addClass($column_class);
switch ($cell_type) {
case 'item_description':