Source
xxxxxxxxxx
<?php
/*
** Zabbix
** 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 General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
/**
* @var CView $this
*/
$output = [
'header' => $data['title']
];
$options = $data['options'];
$http_popup_form = (new CForm())
->cleanItems()
->setId('http_step')
->addVar('no', $options['no'])
->addVar('httpstepid', $options['httpstepid'])
->addItem((new CVar('templated', $options['templated']))->removeId())
->addVar('old_name', $options['old_name'])
->addVar('steps_names', $options['steps_names'])
->addVar('action', 'popup.httpstep');
// Enable form submitting on Enter.
$http_popup_form->addItem((new CSubmitButton(null))->addClass(ZBX_STYLE_FORM_SUBMIT_HIDDEN));
$http_popup_form_list = (new CFormList())
->addRow(
(new CLabel(_('Name'), 'step_name'))->setAsteriskMark(),
(new CTextBox('name', $options['name'], (bool) $options['templated'], 64))
->setAriaRequired()
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setId('step_name')
)
->addRow(
(new CLabel(_('URL'), 'url'))->setAsteriskMark(),
new CDiv([
(new CTextBox('url', $options['url'], false, null))
->setAriaRequired()
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH),
(new CDiv())->addClass(ZBX_STYLE_FORM_INPUT_MARGIN),
(new CButton('parse', _('Parse')))
->onClick('httpconf.steps.edit_form.parseUrl();')
->addClass(ZBX_STYLE_BTN_GREY)
])
);
$http_popup_form_list->addRow(_('Query fields'),
(new CDiv(
(new CTable())
->addClass('httpconf-dynamic-row')
->addStyle('width: 100%;')
->setAttribute('data-type', 'query_fields')
->setHeader(['', _('Name'), '', _('Value'), ''])
->addRow((new CRow([
(new CCol(
(new CButton(null, _('Add')))
->addClass('element-table-add')
->addClass(ZBX_STYLE_BTN_LINK)
))->setColSpan(5)
])))
))
->addClass(ZBX_STYLE_TABLE_FORMS_SEPARATOR)
->addStyle('min-width: '.ZBX_TEXTAREA_BIG_WIDTH . 'px;'),
'query-fields-row'
);
$http_popup_form_list->addRow(_('Post type'), (new CRadioButtonList('post_type', (int) $options['post_type']))
->addValue(_('Form data'), ZBX_POSTTYPE_FORM)
->addValue(_('Raw data'), ZBX_POSTTYPE_RAW)
->setModern(true)
);