Source
$cell[Widget::CELL_METADATA]['is_view_value_in_column'] = array_key_exists($table_column_index, $columns_with_view_values);
<?php declare(strict_types = 0);
/*
** 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 Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
namespace Widgets\TopItems\Actions;
use API,
CArrayHelper,
CControllerDashboardWidgetView,
CControllerResponseData,
CItemHelper,
CNumberParser,
CSettingsHelper,
CWidgetsData,
CSvgGraph,
Manager;
use Widgets\TopItems\Includes\{
WidgetForm,
CWidgetFieldColumnsList
};
use Widgets\TopItems\Widget;
use Zabbix\Widgets\CWidgetField;
class WidgetView extends CControllerDashboardWidgetView {
/** @property int $sparkline_max_samples Limit of samples when requesting sparkline graph data for time period. */
protected int $sparkline_max_samples;
protected function init(): void {
parent::init();
$this->addValidationRules([
'contents_width' => 'int32'
]);
}
protected function doAction(): void {
$data = [
'name' => $this->getInput('name', $this->widget->getDefaultName()),
'user' => [
'debug_mode' => $this->getDebugMode()
]
];
// Editing template dashboard?
if ($this->isTemplateDashboard() && !$this->fields_values['override_hostid']) {
$data['error'] = _('No data.');
}
else {