From 93b248bf1433490f438f1aec16c0f3d770525502 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Thu, 18 Dec 2014 14:40:29 +0100 Subject: [PATCH] Preparing the element detail output for the tree view --- pandora_console/include/ajax/tree.ajax.php | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/pandora_console/include/ajax/tree.ajax.php b/pandora_console/include/ajax/tree.ajax.php index 7ae8529cf3..bc8d16a206 100644 --- a/pandora_console/include/ajax/tree.ajax.php +++ b/pandora_console/include/ajax/tree.ajax.php @@ -40,6 +40,45 @@ if (is_ajax ()) { return; } + $get_detail = (bool) get_parameter('getDetail'); + if ($get_detail) { + require_once($config['homedir']."/include/functions_treeview.php"); + + // Clean the output + ob_clean(); + + $id = (int) get_parameter('id'); + $type = (string) get_parameter('type'); + + $server = array(); + if (defined ('METACONSOLE')) { + $server_name = (string) get_parameter('server'); + $server = metaconsole_get_connection($server_name); + metaconsole_connect($server); + } + + switch ($type) { + case 'agent': + treeview_printTable($id, $server); + break; + case 'module': + treeview_printModuleTable($id, $server); + break; + case 'alert': + treeview_printAlertsTable($id, $server); + break; + default: + // Nothing + break; + } + + if (!empty($server) && defined ('METACONSOLE')) { + metaconsole_restore_db(); + } + + return; + } + return; } ?> \ No newline at end of file