1<?php 2/* 3** Zabbix 4** Copyright (C) 2001-2021 Zabbix SIA 5** 6** This program is free software; you can redistribute it and/or modify 7** it under the terms of the GNU General Public License as published by 8** the Free Software Foundation; either version 2 of the License, or 9** (at your option) any later version. 10** 11** This program is distributed in the hope that it will be useful, 12** but WITHOUT ANY WARRANTY; without even the implied warranty of 13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14** GNU General Public License for more details. 15** 16** You should have received a copy of the GNU General Public License 17** along with this program; if not, write to the Free Software 18** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19**/ 20 21 22/** 23 * @var CView $this 24 */ 25 26$this->addJsFile('gtlc.js'); 27$this->addJsFile('flickerfreescreen.js'); 28$this->addJsFile('class.svg.canvas.js'); 29$this->addJsFile('class.svg.map.js'); 30$this->addJsFile('layout.mode.js'); 31$this->includeJsFile('monitoring.map.view.js.php'); 32 33$this->enableLayoutModes(); 34$web_layout_mode = $this->getLayoutMode(); 35 36(new CWidget()) 37 ->setTitle(_('Maps')) 38 ->setWebLayoutMode($web_layout_mode) 39 ->setControls(new CList([ 40 (new CForm('get')) 41 ->cleanItems() 42 ->setName('map.view') 43 ->addVar('action', 'map.view') 44 ->addVar('sysmapid', $data['map']['sysmapid']) 45 ->setAttribute('aria-label', _('Main filter')) 46 ->addItem((new CList()) 47 ->addItem([ 48 new CLabel(_('Minimum severity'), 'label-severity-min'), 49 (new CDiv())->addClass(ZBX_STYLE_FORM_INPUT_MARGIN), 50 (new CSelect('severity_min')) 51 ->setFocusableElementId('label-severity-min') 52 ->setValue($data['severity_min']) 53 ->addOptions(CSelect::createOptionsFromArray($data['severities'])) 54 ]) 55 ), 56 (new CTag('nav', true, (new CList()) 57 ->addItem($data['map']['editable'] 58 ? (new CRedirectButton(_('Edit map'), (new CUrl('sysmap.php')) 59 ->setArgument('sysmapid', $data['map']['sysmapid']) 60 ->getUrl() 61 ))->setEnabled($data['allowed_edit']) 62 : null 63 ) 64 ->addItem(get_icon('favourite', [ 65 'fav' => 'web.favorite.sysmapids', 66 'elname' => 'sysmapid', 67 'elid' => $data['map']['sysmapid'] 68 ])) 69 ->addItem(get_icon('kioskmode', ['mode' => $web_layout_mode])) 70 )) 71 ->setAttribute('aria-label', _('Content controls')) 72 ])) 73 ->setNavigation(getSysmapNavigation($data['map']['sysmapid'], $data['map']['name'], $data['severity_min'])) 74 ->addItem( 75 (new CDiv()) 76 ->addClass(ZBX_STYLE_TABLE_FORMS_CONTAINER) 77 ->addStyle('padding: 0;') 78 ->addItem( 79 CScreenBuilder::getScreen([ 80 'resourcetype' => SCREEN_RESOURCE_MAP, 81 'mode' => SCREEN_MODE_PREVIEW, 82 'dataId' => 'mapimg', 83 'screenitem' => [ 84 'screenitemid' => $data['map']['sysmapid'], 85 'screenid' => null, 86 'resourceid' => $data['map']['sysmapid'], 87 'width' => null, 88 'height' => null, 89 'severity_min' => $data['severity_min'] 90 ] 91 ])->get() 92 ) 93 ) 94 ->show(); 95