Source
<?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
*/
require_once __DIR__.'/js/common.template.edit.js.php';
$widget = (new CWidget())->setTitle(_('Templates'));
if ($data['form'] !== 'clone' && $data['form'] !== 'full_clone') {
$widget->setNavigation(getHostNavigation('', $data['templateid']));
}
$tabs = new CTabView();
if (!hasRequest('form_refresh')) {
$tabs->setSelected(0);
}
$form = (new CForm())
->setId('templates-form')
->setName('templatesForm')
->setAttribute('aria-labeledby', ZBX_STYLE_PAGE_TITLE)
->addVar('form', $data['form']);
if ($data['templateid'] != 0) {
$form->addVar('templateid', $data['templateid']);
}
$form->addVar('clear_templates', $data['clear_templates']);
$template_tab = (new CFormList('hostlist'))
->addRow(
(new CLabel(_('Template name'), 'template_name'))->setAsteriskMark(),
(new CTextBox('template_name', $data['template_name'], false, 128))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAriaRequired()
->setAttribute('autofocus', 'autofocus')
)
->addRow(
_('Visible name'),
(new CTextBox('visiblename', $data['visible_name'], false, 128))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
);