Source
<button type="button" class="<?= ZBX_STYLE_BTN_LINK ?>" id="items_#{number}_remove" data-remove="#{number}" onclick="view.removeItem(this);"><?= _('Remove') ?></button>
<?php
/*
** 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 Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/**
* @var CView $this
*/
?>
<script type="text/x-jquery-tmpl" id="tmpl-item-row-<?= GRAPH_TYPE_NORMAL ?>">
<tr id="items_#{number}" class="graph-item">
<!-- icon + hidden -->
<?php if ($readonly): ?>
<td>
<?php else: ?>
<td class="<?= ZBX_STYLE_TD_DRAG_ICON ?>">
<div class="<?= ZBX_STYLE_DRAG_ICON ?>"></div>
<?php endif ?>
<input type="hidden" id="items_#{number}_gitemid" name="items[#{number}][gitemid]" value="#{gitemid}">
<input type="hidden" id="items_#{number}_itemid" name="items[#{number}][itemid]" value="#{itemid}">
<input type="hidden" id="items_#{number}_sortorder" name="items[#{number}][sortorder]" value="#{sortorder}">
<input type="hidden" id="items_#{number}_flags" name="items[#{number}][flags]" value="#{flags}">
<input type="hidden" id="items_#{number}_type" name="items[#{number}][type]" value="<?= GRAPH_ITEM_SIMPLE ?>">
<input type="hidden" id="items_#{number}_calc_fnc" name="items[#{number}][calc_fnc]" value="#{calc_fnc}">
<input type="hidden" id="items_#{number}_drawtype" name="items[#{number}][drawtype]" value="#{drawtype}">
<input type="hidden" id="items_#{number}_yaxisside" name="items[#{number}][yaxisside]" value="#{yaxisside}">
</td>
<!-- row number -->
<td>
<span class="<?= ZBX_STYLE_LIST_NUMBERED_ITEM ?>">:</span>
</td>
<!-- name -->
<td>
<?php if ($readonly): ?>
<span id="items_#{number}_name">#{name}</span>
<?php else: ?>
<a href="javascript:void(0)"><span id="items_#{number}_name">#{name}</span></a>
<?php endif ?>
</td>
<!-- function -->
<td>
<?= (new CSelect('items[#{number}][calc_fnc]'))
->setValue('#{calc_fnc}')
->addOptions(CSelect::createOptionsFromArray([
CALC_FNC_ALL => _('all'),
CALC_FNC_MIN => _('min'),
CALC_FNC_AVG => _('avg'),
CALC_FNC_MAX => _('max')
]))
->setReadonly($readonly)
?>
</td>
<!-- drawtype -->
<td>
<?= (new CSelect('items[#{number}][drawtype]'))
->setValue('#{drawtype}')
->addOptions(CSelect::createOptionsFromArray($graph_item_drawtypes))
->setReadonly($readonly)
?>
</td>
<!-- yaxisside -->
<td>
<?= (new CSelect('items[#{number}][yaxisside]'))
->setValue('#{yaxisside}')
->addOptions(CSelect::createOptionsFromArray([
GRAPH_YAXIS_SIDE_LEFT => _('Left'),
GRAPH_YAXIS_SIDE_RIGHT => _('Right')
]))
->setReadonly($readonly)
?>
</td>
<td>
<?= (new CColor('items[#{number}][color]', '#{color}', 'items_#{number}_color'))