Source
(new CLinkAction($column['value']))->setMenuPopup(CMenuPopupHelper::getHost($column['hostid']))
<?php
/*
** Zabbix
** Copyright (C) 2001-2021 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
*/
$headers = [];
foreach ($data['configuration'] as $column_config) {
if ($column_config['data'] == CWidgetFieldColumnsList::DATA_ITEM_VALUE) {
if ($column_config['display'] == CWidgetFieldColumnsList::DISPLAY_AS_IS) {
$headers[] = (new CColHeader($column_config['name']))->addClass(ZBX_STYLE_CENTER);
}
else {
$headers[] = (new CColHeader($column_config['name']))->setColSpan(2);
}
}
else {
$headers[] = $column_config['name'];
}
}
$table = (new CTableInfo())->setHeader($headers);
foreach ($data['rows'] as $columns) {
$row = [];
foreach ($columns as $i => $column) {
$column_config = $data['configuration'][$i];
if ($column === null) {
if ($column_config['data'] == CWidgetFieldColumnsList::DATA_ITEM_VALUE
&& $column_config['display'] != CWidgetFieldColumnsList::DISPLAY_AS_IS) {
$row[] = (new CCol(''))->setColSpan(2);
}
else {
$row[] = '';
}
continue;
}
$color = $column_config['base_color'];