Source
<?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\Includes;
use Zabbix\Widgets\{
CWidgetField,
CWidgetForm
};
use Zabbix\Widgets\Fields\{
CWidgetFieldIntegerBox,
CWidgetFieldMultiSelectGroup,
CWidgetFieldMultiSelectHost,
CWidgetFieldMultiSelectOverrideHost,
CWidgetFieldPatternSelectHost,
CWidgetFieldPatternSelectItem,
CWidgetFieldRadioButtonList,
CWidgetFieldTags
};
/**
* Top items data widget form.
*/
class WidgetForm extends CWidgetForm {
public const LAYOUT_HORIZONTAL = 0;
public const LAYOUT_VERTICAL = 1;
public const ORDER_TOP_N = 2;
public const ORDER_BOTTOM_N = 3;
public const PROBLEMS_ALL = 0;
public const PROBLEMS_UNSUPPRESSED = 1;
public const PROBLEMS_NONE = 2;
public const COLUMN_HEADER_OFF = 0;
public const COLUMN_HEADER_HORIZONTAL = 1;
public const COLUMN_HEADER_VERTICAL = 2;
public const ORDERBY_HOST_NAME = 0;
public const ORDERBY_HOST = 1;
public const ORDERBY_ITEM_NAME = 2;
public const ORDERBY_ITEM_VALUE = 3;
public function addFields(): self {
return $this
->addField($this->isTemplateDashboard()
? null
: new CWidgetFieldMultiSelectGroup('groupids', _('Host groups'))