diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 1d25c1e576..e22a4ca266 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -283,6 +283,14 @@ if ($get_module_detail) { if ($attr[1] != "modules_format_data") { $data[] = date('d F Y h:i:s A', $row['utimestamp']); } + elseif(is_snapshot_data($row[$attr[0]])){ + if($config['command_snapshot']){ + $data[] = ""; + } + else{ + $data[] = "".wordwrap(io_safe_input($row[$attr[0]]),60,"
\n",true)."
"; + } + } elseif (($config['command_snapshot'] == '0') && (preg_match ("/[\n]+/i", $row[$attr[0]]))) { // Its a single-data, multiline data (data snapshot) ? @@ -342,21 +350,11 @@ if ($get_module_detail) { $data[] = 'No data'; } else { - if(is_snapshot_data($row[$attr[0]])){ - if($config['command_snapshot']){ - $data[] = ""; - } - else{ - $data[] = "".wordwrap(io_safe_input($row[$attr[0]]),60,"
\n",true)."
"; - } - } - else{ - $data_macro = modules_get_unit_macro($row[$attr[0]],$unit); - if($data_macro){ - $data[] = $data_macro; - } else { - $data[] = $row[$attr[0]]; - } + $data_macro = modules_get_unit_macro($row[$attr[0]],$unit); + if($data_macro){ + $data[] = $data_macro; + } else { + $data[] = $row[$attr[0]]; } } } diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 263e586763..dd3b22028f 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -2143,18 +2143,7 @@ function is_image_data ($data) { * Looks for two or more carriage returns. */ function is_snapshot_data ($data) { - - // TODO IDEA: In the future, we can set a variable in setup - // to define how many \n must have a snapshot to define it's - // a snapshot. I think two or three is a good value anyway. - - $temp = array(); - $count = preg_match_all ("/\n/", $data, $temp); - - if ( ($count > 2) || (is_image_data($data)) ) - return 1; - else - return 0; + return is_image_data($data); } /**