1<?php
2/*
3** Zabbix
4** Copyright (C) 2001-2021 Zabbix SIA
5**
6** This program is free software; you can redistribute it and/or modify
7** it under the terms of the GNU General Public License as published by
8** the Free Software Foundation; either version 2 of the License, or
9** (at your option) any later version.
10**
11** This program is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14** GNU General Public License for more details.
15**
16** You should have received a copy of the GNU General Public License
17** along with this program; if not, write to the Free Software
18** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19**/
20
21
22include('include/views/js/administration.general.trigger.options.js.php');
23
24$widget = (new CWidget())
25	->setTitle(_('Trigger displaying options'))
26	->setControls((new CForm())
27		->cleanItems()
28		->addItem((new CList())->addItem(makeAdministrationGeneralMenu('adm.triggerdisplayoptions.php')))
29	);
30
31$triggerDOFormList = (new CFormList())
32	->addRow(_('Unacknowledged PROBLEM events'), [
33		new CColor('problem_unack_color', $data['problem_unack_color']),
34		(new CDiv())->addClass(ZBX_STYLE_FORM_INPUT_MARGIN),
35		new CLabel([
36			(new CCheckBox('problem_unack_style'))->setChecked($data['problem_unack_style'] == 1),
37			_('blinking')
38		], 'problem_unack_style')
39	])
40	->addRow(_('Acknowledged PROBLEM events'), [
41		new CColor('problem_ack_color', $data['problem_ack_color']),
42		(new CDiv())->addClass(ZBX_STYLE_FORM_INPUT_MARGIN),
43		new CLabel([
44			(new CCheckBox('problem_ack_style'))->setChecked($data['problem_ack_style'] == 1),
45			_('blinking')
46		], 'problem_ack_style')
47	])
48	->addRow(_('Unacknowledged OK events'), [
49		new CColor('ok_unack_color', $data['ok_unack_color']),
50		(new CDiv())->addClass(ZBX_STYLE_FORM_INPUT_MARGIN),
51		new CLabel([
52			(new CCheckBox('ok_unack_style'))->setChecked($data['ok_unack_style'] == 1),
53			_('blinking')
54		], 'ok_unack_style')
55	])
56	->addRow(_('Acknowledged OK events'), [
57		new CColor('ok_ack_color', $data['ok_ack_color']),
58		(new CDiv())->addClass(ZBX_STYLE_FORM_INPUT_MARGIN),
59		new CLabel([
60			(new CCheckBox('ok_ack_style'))->setChecked($data['ok_ack_style'] == 1),
61			_('blinking')
62		], 'ok_ack_style')
63	])
64	->addRow(null)
65	->addRow(_('Display OK triggers for'), [
66		(new CTextBox('ok_period', $data['ok_period']))
67			->setWidth(ZBX_TEXTAREA_TINY_WIDTH)
68			->setAttribute('maxlength', '6'),
69		(new CDiv())->addClass(ZBX_STYLE_FORM_INPUT_MARGIN),
70		_('seconds')
71	])
72	->addRow(_('On status change triggers blink for'), [
73		(new CTextBox('blink_period', $data['blink_period']))
74			->setWidth(ZBX_TEXTAREA_TINY_WIDTH)
75			->setAttribute('maxlength', '6'),
76		(new CDiv())->addClass(ZBX_STYLE_FORM_INPUT_MARGIN),
77		_('seconds')
78	]);
79
80$severityForm = (new CForm())
81	->addItem(
82		(new CTabView())
83			->addTab('triggerdo', _('Trigger displaying options'), $triggerDOFormList)
84			->setFooter(makeFormFooter(
85				new CSubmit('update', _('Update')),
86				[new CButton('resetDefaults', _('Reset defaults'))]
87			))
88	);
89
90$widget->addItem($severityForm);
91
92return $widget;
93