From 09f156cd8cf4e972545835aa24e0d171e5036816 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Thu, 7 Apr 2016 12:24:24 +0200 Subject: [PATCH] New maps in progress... (Edit node in progress) --- pandora_console/include/ajax/map.ajax.php | 27 +++++++++---------- .../include/javascript/map/MapController.js | 20 +++++++++++++- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/pandora_console/include/ajax/map.ajax.php b/pandora_console/include/ajax/map.ajax.php index b383280bba..7c6af655f7 100644 --- a/pandora_console/include/ajax/map.ajax.php +++ b/pandora_console/include/ajax/map.ajax.php @@ -328,11 +328,12 @@ if (is_ajax ()) { $id_node_data = (int)get_parameter('id_node_data'); $type = (int)get_parameter('type'); $node_id = get_parameter('node_id'); + $data_graph_id = (int)get_parameter('data_graph_id'); $table = new stdClass(); $table->id = 'node_options_' . $node_id; $table->width = "100%"; - + $table->head = array(); $node_name = __('No name'); @@ -356,22 +357,18 @@ if (is_ajax ()) { $table->data = array(); $table->data[0][0] = __('Label'); $table->data[0][1] = html_print_input_text('label', - $node_style['label'], '', 5, 10, true); - $table->data[3][0] = __('Shape'); - $table->data[3][1] = html_print_select(array( + $node_name, '', 12, 10, true); + $table->data[1][0] = __('Shape'); + $table->data[1][1] = html_print_select(array( 'circle' => __('Circle'), 'square' => __('Square'), - 'rhombus' => __('Rhombus')), 'shape', '', - 'javascript:', '', 0, true) . ' ' . - '' . - '' . - ''; - - ui_toggle(html_print_table($table, true), __('Node options'), - __('Node options'), true); + 'rhombus' => __('Rhombus')), 'shape', 'circle', '', '', 0, true); + + html_print_table($table); + echo '
'; + echo html_print_button(__('Update'), 'upd', false, 'update_node(' . $data_graph_id . ');') . + ui_print_help_tip (__('This function is only fix in Enterprise version')); + echo '
'; ?> diff --git a/pandora_console/include/javascript/map/MapController.js b/pandora_console/include/javascript/map/MapController.js index 31a3522862..65cb6f8812 100644 --- a/pandora_console/include/javascript/map/MapController.js +++ b/pandora_console/include/javascript/map/MapController.js @@ -2415,7 +2415,6 @@ MapController.prototype.editNode = function(self, target) { params["printEditNodeTable"] = 1; params["id_node_data"] = data_id; params["type"] = type; - params["id_map"] = id_map; params["data_graph_id"] = data_graph_id; params["node_id"] = node_id; params["page"] = "include/ajax/map.ajax"; @@ -2865,3 +2864,22 @@ function get_radius_element(element) { return Math.sqrt( Math.pow(size[0] / 2, 2) + Math.pow(size[1] / 2, 2)); } + +function update_node(data_graph_id) { + node_id = "node_" + data_graph_id; + var new_label = $("#edit_node_dialog_" + node_id + " input[id='text-label']").val(); + var new_shape = $("#edit_node_dialog_" + node_id + " select[id='shape']").val(); + + $('#' + node_id + " text").text(new_label); + + switch (new_shape) { + case 'circle': + break; + case 'rhombus': + break; + case 'square': + break; + } + + console.log(new_label, new_shape); +}