Source
<?php declare(strict_types = 0);
/*
** Zabbix
** Copyright (C) 2001-2023 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
* @var array $data
*/
$form = (new CForm())
->setId('webscenario-step-form')
->setName('webscenario_step_form')
->addVar('edit', $data['is_edit'] ? '1' : null)
->addVar('templated', (int) $data['templated'])
->addVar('httpstepid', $data['httpstepid'])
->addVar('old_name', $data['form']['name'])
->addVar('names', $data['names'])
->addItem(getMessages());
// Enable form submitting on Enter.
$form->addItem((new CSubmitButton())->addClass(ZBX_STYLE_FORM_SUBMIT_HIDDEN));
$form_grid = (new CFormGrid())
->addItem([
(new CLabel(_('Name'), 'name'))->setAsteriskMark(),
new CFormField(
(new CTextBox('name', $data['form']['name'], $data['templated'], DB::getFieldLength('httpstep', 'name')))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAriaRequired()
->setAttribute('autofocus', 'autofocus')
)
])
->addItem([
(new CLabel(_('URL'), 'url'))->setAsteriskMark(),
new CFormField([
(new CTextBox('url', $data['form']['url'], false, DB::getFieldLength('httpstep', 'url')))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAriaRequired(),
(new CDiv())->addClass(ZBX_STYLE_FORM_INPUT_MARGIN),
(new CSimpleButton(_('Parse')))
->addClass(ZBX_STYLE_BTN_GREY)
->addClass('js-parse-url')
])
])
->addItem([
new CLabel(_('Query fields')),