require_once dirname(__FILE__).'/include/config.inc.php';
require_once dirname(__FILE__).'/include/maps.inc.php';
require_once dirname(__FILE__).'/include/forms.inc.php';
$page['title'] = _('Configuration of network maps');
$page['file'] = 'sysmaps.php';
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
'maps' => [T_ZBX_INT, O_OPT, P_SYS|P_ONLY_ARRAY, DB_ID, null],
'sysmapid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID,
'isset({form}) && ({form} === "update" || {form} === "full_clone")'
'name' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})', _('Name')],
'width' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), 'isset({add}) || isset({update})', _('Width')],
'height' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), 'isset({add}) || isset({update})', _('Height')],
'backgroundid' => [T_ZBX_INT, O_OPT, null, DB_ID, 'isset({add}) || isset({update})'],
'iconmapid' => [T_ZBX_INT, O_OPT, null, DB_ID, 'isset({add}) || isset({update})'],
'expandproblem' => [T_ZBX_INT, O_OPT, null,
IN([SYSMAP_PROBLEMS_NUMBER, SYSMAP_SINGLE_PROBLEM, SYSMAP_PROBLEMS_NUMBER_CRITICAL]), null
'markelements' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 1), null],
'show_unack' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 2), null],
'highlight' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 1), null],
'label_format' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 1), null],
'label_type_host' => [T_ZBX_INT, O_OPT, null, BETWEEN(MAP_LABEL_TYPE_LABEL, MAP_LABEL_TYPE_CUSTOM), 'isset({add}) || isset({update})'],
'label_type_hostgroup' => [T_ZBX_INT, O_OPT, null, BETWEEN(MAP_LABEL_TYPE_LABEL, MAP_LABEL_TYPE_CUSTOM), 'isset({add}) || isset({update})'],
'label_type_trigger' => [T_ZBX_INT, O_OPT, null, BETWEEN(MAP_LABEL_TYPE_LABEL, MAP_LABEL_TYPE_CUSTOM), 'isset({add}) || isset({update})'],
'label_type_map' => [T_ZBX_INT, O_OPT, null, BETWEEN(MAP_LABEL_TYPE_LABEL, MAP_LABEL_TYPE_CUSTOM), 'isset({add}) || isset({update})'],
'label_type_image' => [T_ZBX_INT, O_OPT, null, BETWEEN(MAP_LABEL_TYPE_LABEL, MAP_LABEL_TYPE_CUSTOM), 'isset({add}) || isset({update})'],
'label_string_host' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'],
'label_string_hostgroup' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'],
'label_string_trigger' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'],
'label_string_map' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'],
'label_string_image' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'],
'label_type' => [T_ZBX_INT, O_OPT, null, BETWEEN(MAP_LABEL_TYPE_LABEL,MAP_LABEL_TYPE_CUSTOM), 'isset({add}) || isset({update})'],
'label_location' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 3), 'isset({add}) || isset({update})'],
'urls' => [T_ZBX_STR, O_OPT, P_ONLY_TD_ARRAY, null, null],
'severity_min' => [T_ZBX_INT, O_OPT, null, IN('0,1,2,3,4,5'), null],
'show_suppressed' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 1), null],
'userid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
'private' => [T_ZBX_INT, O_OPT, null, BETWEEN(0, 1), null],
'users' => [T_ZBX_INT, O_OPT, P_ONLY_TD_ARRAY, null, null],
'userGroups' => [T_ZBX_INT, O_OPT, P_ONLY_TD_ARRAY, null, null],
'action' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, IN('"map.export","map.massdelete"'), null],
'add' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],
'update' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],
'delete' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],
'cancel' => [T_ZBX_STR, O_OPT, P_SYS, null, null],
'form' => [T_ZBX_STR, O_OPT, P_SYS, null, null],
'form_refresh' => [T_ZBX_INT, O_OPT, P_SYS, null, null],
'filter_set' => [T_ZBX_STR, O_OPT, P_SYS, null, null],
'filter_rst' => [T_ZBX_STR, O_OPT, P_SYS, null, null],
'filter_name' => [T_ZBX_STR, O_OPT, null, null, null],
'sort' => [T_ZBX_STR, O_OPT, P_SYS, IN('"height","name","width"'), null],
'sortorder' => [T_ZBX_STR, O_OPT, P_SYS, IN('"'.ZBX_SORT_DOWN.'","'.ZBX_SORT_UP.'"'), null]
if (hasRequest('sysmapid')) {
$sysmap = API::Map()->get([
'sysmapids' => getRequest('sysmapid'),