$name, 'type' => $activeTab, 'layout' => $layout, 'nooverlap' => $nooverlap, 'simple' => $simple, 'regenerate' => $regen, 'font_size' => $font_size, 'id_group' => $group, 'id_module_group' => $module_group, 'depth' => $depth, 'only_modules_with_alerts' => $modwithalerts, 'hide_policy_modules' => $hidepolicymodules, 'zoom' => $zoom, 'distance_nodes' => $ranksep, 'center' => $center, 'show_snmp_modules' => (int)$show_snmp_modules)); $message = ui_print_result_message ($result, __('Network map saved successfully'), __('Could not save network map'), '', true); } } $networkmaps = networkmap_get_networkmaps(); $nomaps = false; if($networkmaps === false) { $nomaps = true; } /*// When is the first map, we create one if($nomaps && $id_networkmap == 0) { $add_networkmap = 1; }*/ // If the map id is not defined, we set the first id of the active type if(!$nomaps && $id_networkmap == 0) { $networkmaps_of_type = networkmap_get_networkmaps('', $activeTab); if($networkmaps_of_type !== false){ $id_networkmap = reset(array_keys($networkmaps_of_type)); } } if(!$update_networkmap && !$save_networkmap && $id_networkmap != 0) { $networkmap_data = networkmap_get_networkmap($id_networkmap); $layout = $networkmap_data['layout']; $depth = $networkmap_data['depth']; $nooverlap = (bool)$networkmap_data['nooverlap']; $modwithalerts = $networkmap_data['only_modules_with_alerts']; $hidepolicymodules = $networkmap_data['hide_policy_modules']; $zoom = $networkmap_data['zoom']; $ranksep = $networkmap_data['distance_nodes']; $simple = $networkmap_data['simple']; $regen = $networkmap_data['regenerate']; $show_snmp_modules = $networkmap_data['show_snmp_modules']; $font_size = $networkmap_data['font_size']; $group = $networkmap_data['id_group']; $module_group = $networkmap_data['id_module_group']; $center = $networkmap_data['center']; $name = $networkmap_data['name']; $activeTab = $networkmap_data['type']; } if($recenter_networkmap) { $center = (int) get_parameter ('center', 0); } /* Main code */ if ($pure == 1) { $buttons['screen'] = array('active' => false, 'text' => '' . html_print_image("images/normalscreen.png", true, array ('title' => __('Normal screen'))) .''); } else { $buttons['screen'] = array('active' => false, 'text' => '' . html_print_image("images/fullscreen.png", true, array ('title' => __('Full screen'))) .''); } if($config['enterprise_installed']) { $buttons['policies'] = array('active' => $activeTab == 'policies', 'text' => '' . html_print_image("images/policies.png", true, array ("title" => __('Policies view'))) .''); } $buttons['groups'] = array('active' => $activeTab == 'groups', 'text' => '' . html_print_image("images/group.png", true, array ("title" => __('Groups view'))) .''); $buttons['topology'] = array('active' => $activeTab == 'topology', 'text' => '' . html_print_image("images/recon.png", true, array ("title" => __('Topology view'))) .''); $buttons['separator'] = array('separator' => ''); $combolist = '
'; $buttons['combolist'] = $combolist; $buttons['addmap'] = array('active' => $activeTab == false, 'text' => '' . html_print_image("images/add.png", true, array ("title" => __('Add map'))) .''); if(!$nomaps && $id_networkmap != 0) { $buttons['deletemap'] = array('active' => $activeTab == false, 'text' => '' . html_print_image("images/cross.png", true, array ("title" => __('Delete map'))) .''); $buttons['savemap'] = array('active' => $activeTab == false, 'text' => '' . html_print_image("images/file.png", true, array ("title" => __('Save map'))) .''); } switch($activeTab){ case 'topology': $title = __('Topology view'); break; case 'groups': $title = __('Groups view'); break; case 'policies': $title = __('Policies view'); break; } if(!empty($name)) { $title .= " » ".$name; } ui_print_page_header (__('Network map')." - ".$title, "images/bricks.png", false, "network_map", false, $buttons); if($delete_networkmap || $add_networkmap || $save_networkmap) { echo $message; } if($id_networkmap == 0) { echo "