diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php
index cb781137e8..baa7d8c626 100755
--- a/pandora_console/operation/tree.php
+++ b/pandora_console/operation/tree.php
@@ -14,900 +14,316 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
-
-
-require_once("tree2.php");
-return;
-////////////////////////////////////////////////////////////////////////
-
-
-define('ALL', -1);
-define('NORMAL', 0);
-define('WARNING', 2);
-define('CRITICAL', 1);
-define('UNKNOWN', 3);
-define('NOT_INIT', 5);
-
-
global $config;
-require_once ($config['homedir'] . '/include/functions_treeview.php');
-
-if (defined ('METACONSOLE')) {
- // For each server defined:
- $servers = db_get_all_rows_sql ("SELECT *
- FROM tmetaconsole_setup
- WHERE disabled = 0");
- if ($servers === false) {
- $servers = array();
- }
-}
-
-if (is_ajax ()) {
- require_once ($config['homedir'] . '/include/functions_reporting.php');
- require_once ($config['homedir'] . '/include/functions_users.php');
- require_once ($config['homedir'] . '/include/functions_servers.php');
-
- global $config;
-
- $enterpriseEnable = false;
- if (enterprise_include_once('include/functions_policies.php') !== ENTERPRISE_NOT_HOOK) {
- $enterpriseEnable = true;
- require_once ('enterprise/include/functions_policies.php');
- require_once ('enterprise/meta/include/functions_ui_meta.php');
- }
-
- $type = get_parameter('type');
- $id = get_parameter('id');
- $id_father = get_parameter('id_father');
- $statusSel = get_parameter('status');
- $search_free = get_parameter('search_free', '');
- $printTable = get_parameter('printTable', 0);
- $printAlertsTable = get_parameter('printAlertsTable', 0);
- $printModuleTable = get_parameter('printModuleTable', 0);
- $server_name = get_parameter('server_name', '');
- $server = array();
- if ($printTable) {
- $id_agente = get_parameter('id_agente');
- if (defined ('METACONSOLE')) {
- $server = metaconsole_get_connection ($server_name);
- metaconsole_connect($server);
- }
-
- treeview_printTable($id_agente, $server);
-
- if (defined ('METACONSOLE')) {
- metaconsole_restore_db();
- }
- }
- if ($printAlertsTable) {
- $id_module = get_parameter('id_module');
-
- if (defined ('METACONSOLE')) {
- $server = metaconsole_get_connection ($server_name);
- metaconsole_connect($server);
- }
-
- treeview_printAlertsTable($id_module, $server);
-
- if (defined ('METACONSOLE')) {
- metaconsole_restore_db();
- }
- }
- if ($printModuleTable) {
- $id_module = get_parameter('id_module');
- $id_agent = get_parameter('id_agent');
-
- if (defined ('METACONSOLE')) {
- $server = metaconsole_get_connection ($server_name);
- metaconsole_connect($server);
- }
-
- treeview_printModuleTable($id_module, $server);
-
-
- if (defined ('METACONSOLE')) {
- metaconsole_restore_db();
- }
- }
-
- /*
- * It's a binary for branch (0 show - 1 hide)
- * and there are 2 position
- * 0 0 - show 2 branch
- * 0 1 - hide the 2º branch
- * 1 0 - hide the 1º branch
- * 1 1 - hide 2 branch
- */
- $lessBranchs = get_parameter('less_branchs');
-
- switch ($type) {
- case 'group':
- case 'os':
- case 'module_group':
- case 'policies':
- case 'module':
- case 'tag':
-
- $countRows = 0;
- if (! defined ('METACONSOLE')) {
- $avariableGroups = users_get_groups();
- $avariableGroupsIds = array_keys($avariableGroups);
- $sql = treeview_getFirstBranchSQL ($type, $id, $avariableGroupsIds, $statusSel, $search_free);
-
- if ($sql === false) {
- $rows = array ();
- }
- else {
- $rows = db_get_all_rows_sql($sql);
- }
- }
- else {
- $rows = array ();
- foreach ($servers as $server) {
- if (metaconsole_connect($server) != NOERR) {
- continue;
- }
- $avariableGroups = users_get_groups();
- $avariableGroupsIds = array_keys($avariableGroups);
- $sql = treeview_getFirstBranchSQL ($type, $id,
- $avariableGroupsIds, $statusSel, $search_free);
- if ($sql === false) {
- $server_rows = array ();
- }
- else {
- $server_rows = db_get_all_rows_sql($sql);
- if ($server_rows === false) {
- $server_rows = array ();
- }
- }
- // Add the server name
- foreach ($server_rows as $key => $row) {
- $server_rows[$key]['server_name'] = $server['server_name'];
- }
- $rows = array_merge($rows, $server_rows);
- }
- metaconsole_restore_db();
- }
- $countRows = count ($rows);
-
- //Empty Branch
- if ($countRows === 0) {
- echo "
\n";
- echo "- ";
- if ($lessBranchs == 1)
- echo html_print_image ("operation/tree/no_branch.png", true, array ("style" => 'vertical-align: middle;'));
- else
- echo html_print_image ("operation/tree/branch.png", true, array ("style" => 'vertical-align: middle;'));
- echo "" . __("Empty") . "";
- echo "
";
- echo "
";
- return;
- }
-
- //Branch with items
- $count = 0;
- echo "\n";
-
- foreach ($rows as $row) {
- $count++;
-
- $agent_info["monitor_alertsfired"] = $row["fired_count"];
- $agent_info["monitor_critical"] = $row["critical_count"];
- $agent_info["monitor_warning"] = $row["warning_count"];
- $agent_info["monitor_unknown"] = $row["unknown_count"];
- $agent_info["monitor_normal"] = $row["normal_count"];
- $agent_info["monitor_notinit"] = $row["notinit_count"];
- $agent_info["modules"] = $row["total_count"];
-
- $agent_info["alert_img"] = agents_tree_view_alert_img ($agent_info["monitor_alertsfired"]);
- $agent_info["status_img"] = agents_tree_view_status_img(
- $agent_info["monitor_critical"],
- $agent_info["monitor_warning"],
- $agent_info["monitor_unknown"],
- $agent_info["modules"],
- $agent_info["monitor_notinit"]);
-
- // Filter by status (only in policy view)
- if ($type == 'policies') {
-
- if ($statusSel == NORMAL) {
- if (strpos($agent_info["status_img"], 'ok') === false)
- continue;
- }
- else if ($statusSel == WARNING) {
- if (strpos($agent_info["status_img"], 'warning') === false)
- continue;
- }
- else if ($statusSel == CRITICAL) {
- if (strpos($agent_info["status_img"], 'critical') === false)
- continue;
- }
- else if ($statusSel == UNKNOWN) {
- if (strpos($agent_info["status_img"], 'down') === false)
- continue;
- }
- }
-
- $less = $lessBranchs;
- $tree_img_id = "tree_image" . $id . "_agent_" . $type . "_" . $row["server_name"] . "_" . $row["id_agente"];
- if ($count != $countRows)
- $img = html_print_image ("operation/tree/closed.png", true, array ("style" => 'vertical-align: middle;', "id" => $tree_img_id, "pos_tree" => "2"));
- else {
- $less = $less + 2; // $less = $less or 0b10
- $img = html_print_image ("operation/tree/last_closed.png", true, array ("style" => 'vertical-align: middle;', "id" => $tree_img_id, "pos_tree" => "3"));
- }
- echo "- ";
- echo "";
-
- if ($lessBranchs == 1)
- html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
- else
- html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
-
- echo $img;
- echo "";
- echo " ";
- echo str_replace('.png' ,'_ball.png',
- str_replace('img', 'img style="vertical-align: middle;"', $agent_info["status_img"])
- );
- echo " ";
- echo str_replace('.png' ,'_ball.png',
- str_replace('img', 'img style="vertical-align: middle;"', $agent_info["alert_img"])
- );
- echo "";
- echo " ";
-
- echo ui_print_truncate_text($row["nombre"], 40, true);
-
- echo " (" . reporting_tiny_stats($row, true) . ")";
-
- if ($row['quiet']) {
- echo " ";
- html_print_image("images/dot_green.disabled.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
- }
- echo "";
- echo "";
- echo "
";
- }
-
- echo "
\n";
- break;
-
- //also aknolegment as second subtree/branch
- case 'agent_group':
- case 'agent_module_group':
- case 'agent_os':
- case 'agent_policies':
- case 'agent_module':
- case 'agent_tag':
- $fatherType = str_replace('agent_', '', $type);
-
- if (defined ('METACONSOLE')) {
- $server = metaconsole_get_connection ($server_name);
- if (metaconsole_connect($server) != NOERR) {
- continue;
- }
- }
-
- $sql = treeview_getSecondBranchSQL ($fatherType, $id, $id_father);
- $rows = db_get_all_rows_sql($sql);
- if (empty($rows)) {
- $rows = array();
- }
- $countRows = count ($rows);
-
- if ($countRows === 0) {
- echo "\n";
- echo "- ";
- switch ($lessBranchs) {
- case 0:
- html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
- html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
- break;
- case 1:
- html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
- html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
- break;
- case 2:
- html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
- html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
- break;
- case 3:
- html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
- html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
- break;
- }
- echo "" . __("Empty") . "";
- echo "
";
- echo "
";
- return;
- }
-
- $count = 0;
- echo "\n";
- foreach ($rows as $row) {
- $count++;
- echo "- ";
-
- switch ($lessBranchs) {
- case 0:
- html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
- html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
- break;
- case 1:
- html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
- html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
- break;
- case 2:
- html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
- html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
- break;
- case 3:
- html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
- html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
- break;
- }
-
- if ($countRows != $count)
- html_print_image ("operation/tree/leaf.png", false, array ("style" => 'vertical-align: middle;', "id" => "tree_image_os_" . $row["id_agente"], "pos_tree" => "1" ));
- else
- html_print_image ("operation/tree/last_leaf.png", false, array ("style" => 'vertical-align: middle;', "id" => "tree_image_os_" . $row["id_agente"], "pos_tree" => "2" ));
-
- // Assign image and status depend on the status data
- switch ($row["estado"]) {
- case AGENT_MODULE_STATUS_NO_DATA:
- case AGENT_MODULE_STATUS_UNKNOWN:
- $status = STATUS_MODULE_NO_DATA;
- $title = __('UNKNOWN');
- break;
- case AGENT_MODULE_STATUS_CRITICAL_BAD:
- $status = STATUS_MODULE_CRITICAL;
- $title = __('CRITICAL');
- break;
- case AGENT_MODULE_STATUS_WARNING:
- $status = STATUS_MODULE_WARNING;
- $title = __('WARNING');
- break;
- default:
- $status = STATUS_MODULE_OK;
- $title = __('NORMAL');
- break;
- }
-
- if (is_numeric($row["datos"])) {
- $title .= " : " . format_for_graph($row["datos"]);
- }
- else {
- $title .= " : " . substr(io_safe_output($row["datos"]),0,42);
- }
-
- echo str_replace('.png' ,'_ball.png',
- str_replace('img', 'img style="vertical-align: middle;"', ui_print_status_image($status, $title,true))
- );
- echo " ";
- echo str_replace('img', 'img style="vertical-align: middle;"', servers_show_type ($row['id_modulo']));
- echo " ";
- $graph_type = return_graphtype ($row["id_tipo_modulo"]);
- $win_handle=dechex(crc32($row["id_agente_modulo"] . $row["nombre"]));
-
- if (defined ('METACONSOLE')) {
- $console_url = $server['server_url'] . '/';
- }
- else {
- $console_url = '';
- }
-
-
- //Icon and link to the Module graph.
- if (defined('METACONSOLE')) {
- $url_module_graph = ui_meta_get_url_console_child(
- $server, null, null, null, null,
- "operation/agentes/stat_win.php?" .
- "type=$graph_type&" .
- "period=86400&" .
- "id=" . $row["id_agente_modulo"] . "&" .
- "label=" . rawurlencode(urlencode(base64_encode($row["nombre"]))) . "&" .
- "refresh=600");
- }
- else {
- $url_module_graph = $console_url .
- "operation/agentes/stat_win.php?" .
- "type=$graph_type&" .
- "period=86400&" .
- "id=" . $row["id_agente_modulo"] . "&" .
- "label=" . rawurlencode(urlencode(base64_encode($row["nombre"]))) . "&" .
- "refresh=600";
- }
- $link ="winopeng('" . $url_module_graph . "','day_".$win_handle."')";
- echo '' . html_print_image ("images/chart_curve.png", true, array ("style" => 'vertical-align: middle;', "border" => "0" )) . '';
-
-
- echo " ";
-
-
- //Icon and link to the Module data.
- if (defined('METACONSOLE')) {
-
- $url_module_data = ui_meta_get_url_console_child(
- $server,
- "estado", "operation/agentes/ver_agente",
- "id_agente=" . $row['id_agente'] . "&" .
- "tab=data_view&" .
- "period=86400&" .
- "id=" . $row["id_agente_modulo"]);
- }
- else {
- $url_module_data = $console_url .
- "index.php?" .
- "sec=estado&" .
- "sec2=operation/agentes/ver_agente&" .
- "id_agente=" . $row['id_agente'] . "&" .
- "tab=data_view&" .
- "period=86400&" .
- "id=" . $row["id_agente_modulo"];
- }
- echo "". html_print_image ("images/binary.png", true, array ("style" => 'vertical-align: middle;', "border" => "0" )) . "";
-
- echo " ";
-
- $nmodule_alerts = db_get_value_sql(sprintf("SELECT count(*) FROM talert_template_modules WHERE id_agent_module = %s", $row["id_agente_modulo"]));
-
- if($nmodule_alerts > 0) {
- echo "";
- echo html_print_image ("images/bell.png", true, array ("style" => 'vertical-align: middle;', "border" => "0", "title" => __('Module alerts') ));
- echo "";
-
- echo " ";
- }
-
- echo "";
- echo ui_print_truncate_text(io_safe_output($row['nombre']), 40, true);
- echo "";
- if ($row['quiet']) {
- echo " ";
- html_print_image("images/dot_green.disabled.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
- }
-
- /*
- if (is_numeric($row["datos"]))
- $data = format_numeric($row["datos"]);
- else
- $data = "".substr(io_safe_output($row["datos"]),0,12)."";
-
- echo "";
- if ($row['utimestamp'] != '') {
- ui_print_help_tip ($row["timestamp"], '', 'images/clock2.png');
- echo " ";
- }
- echo $data;
- if ($row['unit'] != '') {
- echo " ";
- echo '('.$row['unit'].')';
- }
- * */
- echo "
";
- }
- echo "
\n";
- if (defined ('METACONSOLE')) {
- metaconsole_restore_db_force();
- }
- break;
- }
-
- return;
-}
-//End of AJAX code.
-
-include_once($config['homedir'] . "/include/functions_groups.php");
-include_once($config['homedir'] . "/include/functions_os.php");
-include_once($config['homedir'] . "/include/functions_modules.php");
-include_once($config['homedir'] . "/include/functions_servers.php");
-include_once($config['homedir'] . "/include/functions_reporting.php");
-include_once($config['homedir'] . "/include/functions_ui.php");
-
-global $config;
$pure = get_parameter('pure', 0);
+$tab = get_parameter('tab', 'group');
+$search_agent = get_parameter('searchAgent', '');
+$status_agent = get_parameter('statusAgent', AGENT_STATUS_ALL);
+$search_module = get_parameter('searchModule', '');
+$status_module = get_parameter('statusModule', -1);
+// ---------------------Tabs -------------------------------------------
$enterpriseEnable = false;
if (enterprise_include_once('include/functions_policies.php') !== ENTERPRISE_NOT_HOOK) {
$enterpriseEnable = true;
}
-///////// INI MENU AND TABS /////////////
-$img_style = array ("class" => "top", "width" => 16);
-$activeTab = get_parameter('sort_by','group');
+$url = 'index.php?' .
+ 'sec=estado&' .
+ 'sec2=operation/tree&' .
+ 'refr=0&' .
+ 'pure='.$pure.'&' .
+ 'tab=%s';
-$os_tab = array('text' => ""
- . html_print_image ("images/operating_system.png", true, array ("title" => __('OS'))) . "", 'active' => $activeTab == "os");
+$tabs = array();
-$group_tab = array('text' => ""
- . html_print_image ("images/group.png", true, array ("title" => __('Groups'))) . "", 'active' => $activeTab == "group");
+$tabs['tag'] = array(
+ 'text' => "" .
+ html_print_image("images/tag.png", true,
+ array("title" => __('Tags'))) . "",
+ 'active' => ($tab == "tag"));
-$module_group_tab = array('text' => ""
- . html_print_image ("images/module_group.png", true, array ("title" => __('Module groups'))) . "", 'active' => $activeTab == "module_group");
+$tabs['os'] = array(
+ 'text' => "" .
+ html_print_image("images/operating_system.png", true,
+ array("title" => __('OS'))) . "",
+ 'active' => ($tab == "os"));
+
+$tabs['group'] = array(
+ 'text' => "" .
+ html_print_image("images/group.png", true,
+ array("title" => __('Groups'))) . "",
+ 'active' => ($tab == "group"));
+
+$tabs['module_group'] = array(
+ 'text' => "" .
+ html_print_image("images/module_group.png", true,
+ array("title" => __('Module groups'))) . "",
+ 'active' => ($tab == "module_group"));
+
+$tabs['module'] = array(
+ 'text' => "" .
+ html_print_image("images/brick.png", true,
+ array("title" => __('Modules'))) . "",
+ 'active' => ($tab == "module"));
if ($enterpriseEnable) {
- $policies_tab = array('text' => ""
- . html_print_image ("images/policies_mc.png", true, array ("title" => __('Policies'))) . "", 'active' => $activeTab == "policies");
-}
-else {
- $policies_tab = '';
+ $tabs['policies'] = array(
+ 'text' => "" .
+ html_print_image("images/policies_mc.png", true,
+ array("title" => __('Policies'))) . "",
+ 'active' => ($tab == "policies"));
}
-$module_tab = array('text' => ""
- . html_print_image("images/brick.png",
- true,
- array("title" => __('Modules'))) . "",
- 'active' => $activeTab == "module");
-
-$tags_tab = array('text' => ""
- . html_print_image("images/tag.png",
- true,
- array("title" => __('Tags'))) . "",
- 'active' => $activeTab == "tag");
-
-switch ($activeTab) {
- case 'group':
- $order = __('groups');
- break;
- case 'module_group':
- $order = __('module groups');
- break;
- case 'policies':
- $order = __('policies');
- break;
- case 'module':
- $order = __('modules');
+$header_title = __('Tree view') . " - " . __('Sort the agents by %s');
+switch ($tab) {
+ case 'tag':
+ $header_title = sprintf($header_title, __('tags'));
break;
case 'os':
- $order = __('OS');
+ $header_title = sprintf($header_title, __('OS'));
break;
- case 'tag':
- $order = __('tags');
+ case 'group':
+ $header_title = sprintf($header_title, __('groups'));
+ break;
+ case 'module_group':
+ $header_title = sprintf($header_title, __('module groups'));
+ break;
+ case 'module':
+ $header_title = sprintf($header_title, __('modules'));
+ break;
+ case 'policies':
+ if ($enterpriseEnable)
+ $header_title = sprintf($header_title, __('policies'));
break;
}
+if (defined('METACONSOLE'))
+ ui_meta_print_header($header_title, "", $tabs);
+else
+ ui_print_page_header($header_title, "images/extensions.png", false, "", false, $tabs);
+// ---------------------Tabs -------------------------------------------
+
+
if (! defined ('METACONSOLE')) {
- $onheader = array('tag' => $tags_tab,
- 'os' => $os_tab,
- 'group' => $group_tab,
- 'module_group' => $module_group_tab,
- 'policies' => $policies_tab,
- 'module' => $module_tab);
-
- ui_print_page_header(
- __('Tree view') . " - " . __('Sort the agents by ') . $order,
- "images/extensions.png",
- false, "", false, $onheader);
+
}
else {
-
- ui_meta_add_breadcrumb(array(
- 'link' => 'index.php?sec=monitoring&sec2=operation/tree',
- 'text' => __('Tree View')));
- ui_meta_print_page_header($nav_bar);
-
- $img_style = array ("class" => "top", "width" => 16);
- $activeTab = get_parameter('tab','group');
-
// Check if the loaded tab is allowed or not
- $allowed_tabs = array('group');
+ // $allowed_tabs = array('group');
- if ($config['enable_tags_tree']) {
- $allowed_tabs[] = 'tag';
- }
+ // if ($config['enable_tags_tree']) {
+ // $allowed_tabs[] = 'tag';
+ // }
- if (!in_array($activeTab, $allowed_tabs)) {
- db_pandora_audit("HACK Attempt",
- "Trying to access to not allowed tab on tree view");
- include ("general/noaccess.php");
+ // if (!in_array($activeTab, $allowed_tabs)) {
+ // db_pandora_audit("HACK Attempt",
+ // "Trying to access to not allowed tab on tree view");
+ // include ("general/noaccess.php");
- exit;
- }
+ // exit;
+ // }
// End of tab check
-
- $group_tab = array('text' => ""
- . html_print_image ("images/group.png", true,
- array ("title" => __('Groups'))) . "",
- 'active' => $activeTab == "group");
-
- $subsections['group'] = $group_tab;
-
- if ($config['enable_tags_tree']) {
- $tags_tab = array(
- 'text' => "" .
- html_print_image ("images/tag.png", true,
- array ("title" => __('Tags'))) . "",
- 'active' => $activeTab == "tag");
-
- $subsections['tag'] = $tags_tab;
- }
-
- switch ($activeTab) {
- case 'group':
- $subsection = __('Groups');
- $tab = 'group';
- break;
- case 'tag':
- $subsection = __('Tags');
- $tab = 'tag';
- break;
- }
- ui_meta_print_header(__("Tree view"), $subsection, $subsections);
}
+// --------------------- form filter -----------------------------------
+$table = new StdClass();
+// $table->class = "blank";
+$table->width = "100%";
+$table->data = array();
+$table->rowspan = array();
+
+// Agent filter
+$agent_status_arr = array();
+$agent_status_arr[AGENT_STATUS_ALL] = __('All'); //default
+$agent_status_arr[AGENT_STATUS_NORMAL] = __('Normal');
+$agent_status_arr[AGENT_STATUS_WARNING] = __('Warning');
+$agent_status_arr[AGENT_STATUS_CRITICAL] = __('Critical');
+$agent_status_arr[AGENT_STATUS_UNKNOWN] = __('Unknown');
+$agent_status_arr[AGENT_STATUS_NOT_INIT] = __('Not init');
+
+$row = array();
+$row[] = __('Agent status');
+$row[] = html_print_select($agent_status_arr, "status_agent", $status_agent, '', '', 0, true);
+$row[] = __('Search agent');
+$row[] = html_print_input_text("search_agent", $search_agent, '', 40, 30, true);
+
+// Button
+$row[] = html_print_submit_button(__('Filter'), "uptbutton", false, 'class="sub search"', true);
+$table->rowspan[][count($row)-1] = 2;
+
+$table->data[] = $row;
+
+// Module filter
+$module_status_arr = array();
+$module_status_arr[-1] = __('All'); //default
+$module_status_arr[AGENT_MODULE_STATUS_NORMAL] = __('Normal');
+$module_status_arr[AGENT_MODULE_STATUS_WARNING] = __('Warning');
+$module_status_arr[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical');
+$module_status_arr[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown');
+$module_status_arr[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init');
+
+$row = array();
+$row[] = __('Module status');
+$row[] = html_print_select($module_status_arr, "status_module", $status_module, '', '', 0, true);
+$row[] = __('Search module');
+$row[] = html_print_input_text("search_module", $search_module, '', 40, 30, true);
+
+$table->data[] = $row;
+
enterprise_hook('open_meta_frame');
-if (tags_has_user_acl_tags()) {
- ui_print_tags_warning();
-}
-
-echo "
";
-if (! defined ('METACONSOLE')) {
- echo '";
-echo "";
-echo "";
-echo "";
-///////// END MENU AND TABS /////////////
-
-echo "";
-ui_require_javascript_file('pandora_modules');
-
-treeview_printTree($activeTab);
-
-
-enterprise_hook('close_meta_frame');
+echo '';
+// --------------------- form filter -----------------------------------
ui_include_time_picker();
ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascript/i18n/");
+ui_require_javascript_file("TreeController", "include/javascript/tree/");
+
+html_print_image('images/spinner.gif', false,
+ array('class' => "loading_tree",
+ 'style' => 'display: none;'));
+
+echo "";
+echo "
";
+echo "
";
+echo "
";
+echo "
";
+echo "
";
+echo "
";
+echo "
";
+echo "
";
+echo "
";
+echo "
";
+echo "
";
+
+enterprise_hook('close_meta_frame');
+
?>
-