From 609c0791b74ce5d551bb108a2dad58eb8dcfcbb3 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Diaz Date: Mon, 21 Sep 2015 13:42:21 +0200 Subject: [PATCH] Fixd lines in visual console (view section). Ticket#2741 --- .../visual_console_builder.editor.php | 2 +- .../include/functions_visual_map.php | 38 +++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.php b/pandora_console/godmode/reporting/visual_console_builder.editor.php index cd1d763e03..9af06484ac 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.php +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.php @@ -104,7 +104,7 @@ foreach ($layoutDatas as $layoutData) { switch ($layoutData['type']) { case LINE_ITEM: visual_map_print_user_line_handles($layoutData); - visual_map_print_user_lines("write", $layoutData); + visual_map_print_user_lines($layoutData); break; default: visual_map_print_item("write", $layoutData); diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 05e8b74d5f..804fa7427f 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -1708,9 +1708,18 @@ function visual_map_get_status_element($layoutData) { return $status; } -function visual_map_print_user_lines($mode = "read", $layout_data, $proportion = null) { - - if (!empty($proportion)) { +function visual_map_print_user_lines($layout_data, $proportion = null) { + if (empty($proportion)) { + $line = array(); + $line["id"] = $layout_data['id']; + $line["start_x"] = $layout_data['pos_x']; + $line["start_y"] = $layout_data['pos_y']; + $line["end_x"] = $layout_data['width']; + $line["end_y"] = $layout_data['height']; + $line["line_width"] = $layout_data['border_width']; + $line["line_color"] = $layout_data['border_color']; + } + else { $proportion_width = $proportion['proportion_width']; $proportion_height = $proportion['proportion_height']; @@ -1718,17 +1727,17 @@ function visual_map_print_user_lines($mode = "read", $layout_data, $proportion = if ($proportion_width > $proportion_height) { $proportion_line = $proportion_width; } + + $line = array(); + $line["id"] = $layout_data['id']; + $line["start_x"] = $layout_data['pos_x'] * $proportion_width; + $line["start_y"] = $layout_data['pos_y'] * $proportion_height; + $line["end_x"] = $layout_data['width'] * $proportion_width; + $line["end_y"] = $layout_data['height'] * $proportion_height; + $line["line_width"] = $layout_data['border_width'] * $proportion_line; + $line["line_color"] = $layout_data['border_color']; } - - $line = array(); - $line["id"] = $layout_data['id']; - $line["start_x"] = $layout_data['pos_x'] * $proportion_width; - $line["start_y"] = $layout_data['pos_y'] * $proportion_height; - $line["end_x"] = $layout_data['width'] * $proportion_width; - $line["end_y"] = $layout_data['height'] * $proportion_height; - $line["line_width"] = $layout_data['border_width'] * $proportion_line; - $line["line_color"] = $layout_data['border_color']; - + echo '