<?php declare(strict_types = 0);
namespace Widgets\Graph\Actions;
CControllerDashboardWidgetView,
class WidgetView extends CControllerDashboardWidgetView {
protected function init(): void {
$this->addValidationRules([
'dashboardid' => 'db dashboard.dashboardid',
'contents_width' => 'int32',
'contents_height' => 'int32',
'has_custom_time_period' => 'in 1'
protected function doAction(): void {
$edit_mode = (int) $this->getInput('edit_mode', 0);
$width = (int) $this->getInput('contents_width', 100);
$height = (int) $this->getInput('contents_height', 100);
$profileIdx = 'web.dashboard.filter';
$profileIdx2 = $this->getInput('dashboardid', 0);
$is_resource_available = true;
$header_name = $this->widget->getDefaultName();
if ($this->fields_values['source_type'] == ZBX_WIDGET_FIELD_RESOURCE_GRAPH && $this->fields_values['graphid']) {
$resource_type = SCREEN_RESOURCE_GRAPH;
$resourceid = reset($this->fields_values['graphid']);
$graph_dims = getGraphDims($resourceid);
$graph_dims['graphHeight'] = $height;
$graph_dims['width'] = $width;
elseif ($this->fields_values['source_type'] == ZBX_WIDGET_FIELD_RESOURCE_SIMPLE_GRAPH
&& $this->fields_values['itemid']) {