From c5baf3670b7c547e3462d71ee936bd19634fdf1a Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 4 Feb 2016 11:45:17 +0100 Subject: [PATCH] Add the first version of new map viewer. --- pandora_console/include/functions_maps.php | 45 +++++++++++++++---- .../include/functions_networkmaps.php | 15 +++++-- 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/pandora_console/include/functions_maps.php b/pandora_console/include/functions_maps.php index 26fa02515b..7d9a5992f8 100644 --- a/pandora_console/include/functions_maps.php +++ b/pandora_console/include/functions_maps.php @@ -91,16 +91,22 @@ function maps_duplicate_items_map($id, $map_items) { if ($result_copy_item) { $item_relations = db_get_all_rows_sql("SELECT * FROM trel_item WHERE id = " . $item['id']); if ($item['id'] == $item_relations['parent_id']) { - $copy_item_relations = array('id_parent' => $result_copy_item, - 'id_child' => $item_relations['id_child'], 'parent_type' => $item_relations['parent_type'], - 'child_type' => $item_relations['child_type'], 'id_item' => $item_relations['id_item'] - 'deleted' => $item_relations['deleted']); + $copy_item_relations = array( + 'id_parent' => $result_copy_item, + 'id_child' => $item_relations['id_child'], + 'parent_type' => $item_relations['parent_type'], + 'child_type' => $item_relations['child_type'], + 'id_item' => $item_relations['id_item'], + 'deleted' => $item_relations['deleted']); } else { - $copy_item_relations = array('id_parent' => $item_relations['id_parent'], - 'id_child' => $result_copy_item, 'parent_type' => $item_relations['parent_type'], - 'child_type' => $item_relations['child_type'], 'id_item' => $item_relations['id_item'] - 'deleted' => $item_relations['deleted']); + $copy_item_relations = array( + 'id_parent' => $item_relations['id_parent'], + 'id_child' => $result_copy_item, + 'parent_type' => $item_relations['parent_type'], + 'child_type' => $item_relations['child_type'], + 'id_item' => $item_relations['id_item'], + 'deleted' => $item_relations['deleted']); } db_process_sql_insert('trel_item', $copy_item_relations); } @@ -155,10 +161,31 @@ function maps_show($id) { if (maps_is_networkmap($id)) { require_once("include/functions_networkmaps.php"); - networkmaps_show($id); + $map = new Networkmap($id); + $map->show(); } else { //TODO VISUAL } } + +class Map { + protected $id = null; + + public function __construct($id) { + $this->id = $id; + } + + public function show() { + ?> +
+ + + + + +
+ diff --git a/pandora_console/include/functions_networkmaps.php b/pandora_console/include/functions_networkmaps.php index e3c4ac50be..fef372c33b 100644 --- a/pandora_console/include/functions_networkmaps.php +++ b/pandora_console/include/functions_networkmaps.php @@ -22,12 +22,19 @@ */ function networkmaps_show($id) { - if (maps_is_networkmap($id)) - return false; - maps_show($id); networkmaps_show_staged_area($id); networkmaps_show_black_list_staged_area($id); -} +} + +class Networkmap extends Map { + public function __construct($id) { + parent::__construct($id); + } + + public function show() { + parent::show(); + } +} ?> \ No newline at end of file