Source
$errors[] = _s('Invalid parameter "%1$s": %2$s.', _('Max'), _s('value must be greater than "%1$s"', $min));
<?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\Gauge\Includes;
use API,
CNumberParser;
use Zabbix\Widgets\{
CWidgetField,
CWidgetForm
};
use Zabbix\Widgets\Fields\{
CWidgetFieldCheckBox,
CWidgetFieldCheckBoxList,
CWidgetFieldColor,
CWidgetFieldIntegerBox,
CWidgetFieldMultiSelectItem,
CWidgetFieldMultiSelectOverrideHost,
CWidgetFieldRadioButtonList,
CWidgetFieldSelect,
CWidgetFieldTextArea,
CWidgetFieldTextBox,
CWidgetFieldNumericBox,
CWidgetFieldThresholds
};
use Widgets\Gauge\Widget;
/**
* Gauge widget form.
*/
class WidgetForm extends CWidgetForm {
private const SIZE_PERCENT_MIN = 1;
private const SIZE_PERCENT_MAX = 100;
// Angle values and defaults.
private const ANGLES = [180, 270];
private const DEFAULT_ANGLE = 180;
// Scale defaults.
private const DEFAULT_MIN = 0;
private const DEFAULT_MAX = 100;
private const DEFAULT_SCALE_DECIMAL_PLACES = 0;
private const DEFAULT_SCALE_SHOW_UNITS = 1;
private const DEFAULT_SCALE_SIZE_PERCENT = 15;
// Description defaults.