From 98bf61fd12c75bef636be004377e272e3a9142cd Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 5 May 2016 12:54:04 +0200 Subject: [PATCH] Some fixes for the new networkmap in the enterprise metaconsole. --- .../operation/maps/networkmap_editor.php | 104 +++++++++++++----- .../operation/maps/networkmap_list.php | 7 +- 2 files changed, 80 insertions(+), 31 deletions(-) diff --git a/pandora_console/operation/maps/networkmap_editor.php b/pandora_console/operation/maps/networkmap_editor.php index b7b4c4be1a..4d660fcde1 100644 --- a/pandora_console/operation/maps/networkmap_editor.php +++ b/pandora_console/operation/maps/networkmap_editor.php @@ -102,38 +102,82 @@ if ($edit_networkmap) { } //+++++++++++++++TABLE TO CREATE/EDIT NETWORKMAP++++++++++++++++++++++ - -$buttons['list'] = array('active' => false, - 'text' => '' . - html_print_image("images/list.png", true, - array ('title' => __('List of networkmaps'))) . - ''); - -if ($create_networkmap) { - ui_print_page_header(__('Create networkmap'), "images/bricks.png", - false, "network_list", false, $buttons); -} -else { - $buttons['edit'] = array('active' => true, - 'text' => '' . - html_print_image("images/cog.png", true, - array ('title' => __('Edit networkmap'))) . - ''); - if (enterprise_installed()) { - $buttons['deleted'] = array('active' => false, - 'text' => '' . - html_print_image("images/list.png", true, - array ('title' => __('Deleted list'))) . - ''); - } - $buttons['networkmap'] = array('active' => false, - 'text' => '' . - html_print_image("images/op_network.png", true, - array ('title' => __('View networkmap'))) . +if (enterprise_installed() && defined('METACONSOLE')) { + $buttons['list'] = array('active' => true, + 'text' => '' . + html_print_image("images/list.png", true, + array ('title' => __('List of networkmaps'))) . ''); - ui_print_page_header(__('Update networkmap'), "images/bricks.png", - false, "network_list", false, $buttons); + if ($create_networkmap) { + $title_header = __('Create networkmap'); + } + else { + $title_header = __('Update networkmap'); + + $buttons['edit'] = array('active' => true, + 'text' => '' . + html_print_image("images/cog.png", true, + array ('title' => __('Edit networkmap'))) . + ''); + if (enterprise_installed()) { + $buttons['deleted'] = array('active' => false, + 'text' => '' . + html_print_image("images/list.png", true, + array ('title' => __('Deleted list'))) . + ''); + } + $buttons['networkmap'] = array('active' => false, + 'text' => '' . + html_print_image("images/op_network.png", true, + array ('title' => __('View networkmap'))) . + ''); + } + + // Bread crumbs + ui_meta_add_breadcrumb( + array('link' => + 'index.php?sec=screen&sec2=screens/screens&action=networkmap', + 'text' => $title_header)); + + ui_meta_print_page_header($nav_bar); + + //Print header + ui_meta_print_header($title_header, "", $buttons); +} +else { + $buttons['list'] = array('active' => false, + 'text' => '' . + html_print_image("images/list.png", true, + array ('title' => __('List of networkmaps'))) . + ''); + + if ($create_networkmap) { + ui_print_page_header(__('Create networkmap'), "images/bricks.png", + false, "network_list", false, $buttons); + } + else { + $buttons['edit'] = array('active' => true, + 'text' => '' . + html_print_image("images/cog.png", true, + array ('title' => __('Edit networkmap'))) . + ''); + if (enterprise_installed()) { + $buttons['deleted'] = array('active' => false, + 'text' => '' . + html_print_image("images/list.png", true, + array ('title' => __('Deleted list'))) . + ''); + } + $buttons['networkmap'] = array('active' => false, + 'text' => '' . + html_print_image("images/op_network.png", true, + array ('title' => __('View networkmap'))) . + ''); + + ui_print_page_header(__('Update networkmap'), "images/bricks.png", + false, "network_list", false, $buttons); + } } if ($not_found) { diff --git a/pandora_console/operation/maps/networkmap_list.php b/pandora_console/operation/maps/networkmap_list.php index 96de07c18d..75573a1ea0 100644 --- a/pandora_console/operation/maps/networkmap_list.php +++ b/pandora_console/operation/maps/networkmap_list.php @@ -467,7 +467,12 @@ html_print_input_hidden ('ids_multiple_delete', ""); html_print_button(__('Delete'), 'del', false, 'submit_multiple_delete();', 'class="sub delete"'); echo ''; -echo '
'; +$action_url = 'index.php?sec=maps&sec2=operation/maps/networkmap_editor'; +if (enterprise_installed() && defined('METACONSOLE')) { + $action_url = 'index.php?sec=screen&sec2=screens/screens'; +} + +echo ''; html_print_input_hidden ('create_networkmap', 1); html_print_submit_button (__('Create'), "crt", false, 'class="sub next"'); echo '
';