New maps in progress... (Preliminar edit node table)

This commit is contained in:
Arturo Gonzalez 2016-03-10 11:06:52 +01:00
parent 1330fd5a5f
commit 9ceb3c15e4
2 changed files with 82 additions and 1 deletions

View File

@ -25,6 +25,7 @@ if (is_ajax ()) {
$getNodeData = (bool)get_parameter('getNodeData', 0);
$getNodeDetails = (bool)get_parameter('getNodeDetails', 0);
$printEditNodeTable = (bool)get_parameter('printEditNodeTable', 0);
if ($getNodeData) {
$id_node_data = (int)get_parameter('id_node_data');
@ -271,6 +272,51 @@ if (is_ajax ()) {
echo json_encode($details);
return;
}
else if ($printEditNodeTable) {
?>
<div id="dialog_node_edit" style="display: none;" title="<?php echo __('Edit node');?>">
<div style="text-align: left; width: 100%;">
<?php
// $table = null;
// $table->id = 'node_options';
// $table->width = "100%";
//
// $table->data = array();
//
// $table->data[0][0] = __('Shape');
// $table->data[0][1] = html_print_select(array(
// 'circle' => __('Circle'),
// 'square' => __('Square'),
// 'rhombus' => __('Rhombus')), 'shape', '',
// 'javascript:', '', 0, true) . '&nbsp;' .
// '<span id="shape_icon_in_progress" style="display: none;">' .
// html_print_image('images/spinner.gif', true) . '</span>' .
// '<span id="shape_icon_correct" style="display: none;">' .
// html_print_image('images/dot_green.png', true) . '</span>' .
// '<span id="shape_icon_fail" style="display: none;">' .
// html_print_image('images/dot_red.png', true) . '</span>';
//
// $table->data["fictional_node_name"][0] = __('Name');
// $table->data["fictional_node_name"][1] = html_print_input_text('edit_name_fictional_node',
// '', __('name fictional node'), '20', '50', true);
//
// $table->data["fictional_node_update_button"][0] = '';
// $table->data["fictional_node_update_button"][1] =
// html_print_button(__('Update fictional node'), '', false,
// 'add_fictional_node();', 'class="sub"', true);
//
//
// ui_toggle(html_print_table($table, true), __('Node options'),
// __('Node options'), true);
echo('PUTA');
?>
</div>
</div>
<?php
echo('CCCC');
return;
}
}
?>

View File

@ -392,7 +392,7 @@ MapController.prototype.init_events = function(principalObject) {
{
title: 'Edit',
action: function(elm, d, i) {
console.log('Edit node!!');
self.editNode(self, elm);
}
},
{
@ -584,6 +584,41 @@ MapController.prototype.nodeGetDetails = function(data_id, type, id_map, data_gr
});
}
/**
* Function editNode
* Return void
* This function prints the node table
*/
MapController.prototype.editNode = function(self, target) {
var nodeTarget = $(target);
var id_map = self._id;
var type = parseInt(nodeTarget.data("type"));
var data_id = parseInt(nodeTarget.data("id"));
var data_graph_id = parseInt(nodeTarget.data("graph_id"));
var node_id = nodeTarget.attr("id");
var params = {};
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";
jQuery.ajax ({
data: params,
dataType: "html",
type: "POST",
url: "ajax.php",
success: function (data) {
console.log(data);
}
});
}
/**
* Function deleteNode
* Return void