Source
(new CTextBox('parameters[value][]', $parameter['value'], false, DB::getFieldLength('script_param', 'value')))
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 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
*/
$this->addJsFile('multilineinput.js');
$this->includeJsFile('administration.script.edit.js.php');
$widget = (new CWidget())
->setTitle(_('Scripts'))
->setDocUrl(CDocHelper::getUrl(CDocHelper::ADMINISTRATION_SCRIPT_EDIT));
$row_template = (new CTag('script', true))
->setId('parameters-row')
->setAttribute('type', 'text/x-jquery-tmpl')
->addItem(
(new CRow([
(new CTextBox('parameters[name][]', '', false, DB::getFieldLength('script_param', 'name')))
->setAttribute('style', 'width: 100%;')
->removeId(),
(new CTextBox('parameters[value][]', '', false, DB::getFieldLength('script_param', 'value')))
->setAttribute('style', 'width: 100%;')
->removeId(),
(new CButton('', _('Remove')))
->removeId()
->onClick('$(this).closest("tr").remove()')
->addClass(ZBX_STYLE_BTN_LINK)
->addClass('element-table-remove')
]))->addClass('form_row')
);
$widget->addItem($row_template);
$form = (new CForm())
->setId('script-form')
->setName('scripts')
->setAttribute('aria-labeledby', ZBX_STYLE_PAGE_TITLE)
->addVar('form', 1)
->addVar('scriptid', $data['scriptid']);
$parameters_table = (new CTable())
->setId('parameters-table')