mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Fixed maps in Windows. Tiquet: #2153
This commit is contained in:
parent
737e085a81
commit
298b509b97
@ -80,8 +80,16 @@ else {
|
|||||||
io_safe_output($config['graphviz_bin_dir'] . "/")
|
io_safe_output($config['graphviz_bin_dir'] . "/")
|
||||||
:
|
:
|
||||||
"";
|
"";
|
||||||
|
$is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
|
||||||
|
if ($is_windows) {
|
||||||
|
$graphviz_path = str_replace("/", "\\", $graphviz_path );
|
||||||
|
$filter = $filter . '.exe';
|
||||||
|
}
|
||||||
|
|
||||||
$cmd = escapeshellarg($graphviz_path.$filter) . " -Tcmapx " . escapeshellarg("-o$filename_map") . " -Tpng ". escapeshellarg("-o$filename_img") . " " . escapeshellarg($filename_dot);
|
$cmd = escapeshellarg($graphviz_path.$filter) . " -Tcmapx " .
|
||||||
|
escapeshellarg("-o$filename_map") . " -Tpng ".
|
||||||
|
escapeshellarg("-o$filename_img") . " " .
|
||||||
|
escapeshellarg($filename_dot);
|
||||||
$result = system ($cmd);
|
$result = system ($cmd);
|
||||||
fclose ($fh);
|
fclose ($fh);
|
||||||
unlink ($filename_dot);
|
unlink ($filename_dot);
|
||||||
@ -99,7 +107,10 @@ if ($result !== false) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
echo "<div style='text-align:center'>";
|
echo "<div style='text-align:center'>";
|
||||||
$image_url = str_replace(realpath(io_safe_output($config['homedir'])), "", realpath($filename_img));
|
if ($is_windows)
|
||||||
|
$image_url = str_replace('\\',"/",str_replace($config['homedir'], "", $filename_img));
|
||||||
|
else
|
||||||
|
$image_url = str_replace(realpath(io_safe_output($config['homedir'])), "", realpath($filename_img));
|
||||||
html_print_image ($image_url, false, array ("alt" => __('Network map'), "usemap" => "#networkmap"));
|
html_print_image ($image_url, false, array ("alt" => __('Network map'), "usemap" => "#networkmap"));
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
require ($filename_map);
|
require ($filename_map);
|
||||||
|
@ -85,13 +85,20 @@ else {
|
|||||||
io_safe_output($config['graphviz_bin_dir'] . "/")
|
io_safe_output($config['graphviz_bin_dir'] . "/")
|
||||||
:
|
:
|
||||||
"";
|
"";
|
||||||
|
$is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
|
||||||
|
if ($is_windows) {
|
||||||
|
$graphviz_path = str_replace("/", "\\", $graphviz_path );
|
||||||
|
$filename_map = str_replace("/", "\\", $filename_map );
|
||||||
|
$filename_img = str_replace("/", "\\", $filename_img );
|
||||||
|
$filename_dot = str_replace("/", "\\", $filename_dot );
|
||||||
|
$filter = $filter . '.exe';
|
||||||
|
}
|
||||||
$cmd = escapeshellarg($graphviz_path . $filter) .
|
$cmd = escapeshellarg($graphviz_path . $filter) .
|
||||||
" -Tcmapx " . escapeshellarg("-o$filename_map") .
|
" -Tcmapx " . escapeshellarg("-o$filename_map") .
|
||||||
" -Tpng ". escapeshellarg("-o$filename_img") .
|
" -Tpng ". escapeshellarg("-o$filename_img") .
|
||||||
" " . escapeshellarg($filename_dot);
|
" " . escapeshellarg($filename_dot);
|
||||||
$result = system ($cmd);
|
|
||||||
|
|
||||||
|
$result = system ($cmd);
|
||||||
fclose ($fh);
|
fclose ($fh);
|
||||||
unlink ($filename_dot);
|
unlink ($filename_dot);
|
||||||
//~ html_debug_print($cmd);
|
//~ html_debug_print($cmd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user