Source
$name[] = makeGraphTemplatePrefix($graphid, $data['parent_templates'], $flag, $data['allowed_ui_conf_templates']);
<?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->includeJsFile('configuration.graph.list.js.php');
if (!empty($this->data['parent_discoveryid'])) {
$widget = (new CWidget())
->setTitle(_('Graph prototypes'))
->setControls(
(new CTag('nav', true,
(new CList())->addItem(new CRedirectButton(_('Create graph prototype'),
(new CUrl('graphs.php'))
->setArgument('form', 'create')
->setArgument('parent_discoveryid', $data['parent_discoveryid'])
->setArgument('context', $data['context'])
->getUrl()
))
))->setAttribute('aria-label', _('Content controls'))
)
->setNavigation(getHostNavigation('graphs', $this->data['hostid'], $this->data['parent_discoveryid']));
}
else {
$widget = (new CWidget())
->setTitle(_('Graphs'))
->setControls(
(new CTag('nav', true, ($data['hostid'] == 0)
? (new CButton('form',
($data['context'] === 'host')
? _('Create graph (select host first)')
: _('Create graph (select template first)')
))->setEnabled(false)
: new CRedirectButton(_('Create graph'), (new CUrl('graphs.php'))
->setArgument('hostid', $data['hostid'])
->setArgument('form', 'create')
->setArgument('context', $data['context'])
->getUrl()
)
))
->setAttribute('aria-label', _('Content controls'))
);