Fixed combo in editor

This commit is contained in:
Arturo Gonzalez 2017-08-23 10:19:56 +02:00
parent 60757b0ad6
commit bc557573ec
4 changed files with 36 additions and 5 deletions

View File

@ -1447,7 +1447,7 @@ function networkmap_open_graph ($layout, $nooverlap, $pure, $zoom,
$head .= "size=\"$size\";";
$head .= "\n";
return $head;
}

View File

@ -69,6 +69,7 @@ function networkmap_process_networkmap($id = 0) {
$layout = "spring2";
break;
}
$simple = 0;
$font_size = 12;
$nooverlap = false;
@ -85,7 +86,7 @@ function networkmap_process_networkmap($id = 0) {
case 1:
$recon_task = db_get_row_filter('trecon_task',
array('id_rt' => $networkmap['source_data']));
$ip_mask = $recon_task['subnet'];
break;
case 2:
@ -140,7 +141,7 @@ function networkmap_process_networkmap($id = 0) {
$filename_dot .= "_nooverlap";
}
$filename_dot .= "_" . $id . ".dot";
file_put_contents($filename_dot, $graph);
switch (PHP_OS) {
@ -154,11 +155,12 @@ function networkmap_process_networkmap($id = 0) {
break;
default:
$filename_plain = sys_get_temp_dir() . "/plain.txt";
$cmd = "$filter -Tplain -o " . $filename_plain . " " .
$filename_dot;
break;
}
system ($cmd);
unlink($filename_dot);

View File

@ -207,12 +207,14 @@ else if ($update_networkmap || $copy_networkmap || $delete) {
$recon_task_id = (int) get_parameter(
'recon_task_id', 0);
$source = (string)get_parameter('source', 'group');
$values = array();
$values['name'] = $name;
$values['id_group'] = $id_group;
/*
if ($source == 'group') {
$values['source'] = 0;
$values['source_data'] = $id_group;
@ -225,6 +227,32 @@ else if ($update_networkmap || $copy_networkmap || $delete) {
$values['source'] = 2;
$values['source_data'] = $ip_mask;
}
*/
switch ($method) {
case 'twopi':
$values['generation_method'] = 2;
break;
case 'dot':
$values['generation_method'] = 1;
break;
case 'circo':
$values['generation_method'] = 0;
break;
case 'neato':
$values['generation_method'] = 3;
break;
case 'fdp':
$values['generation_method'] = 4;
break;
case 'radial_dinamic':
$values['generation_method'] = 6;
break;
default:
$values['generation_method'] = 2;
break;
}
$description = get_parameter('description', '');
$values['description'] = $description;

View File

@ -756,6 +756,7 @@ else {
}
$nodes_and_relations = networkmap_process_networkmap($id);
show_networkmap($id, $user_readonly, $nodes_and_relations, $dash_mode, $map_dash_details);
}
?>