'', 'statusAgent' => AGENT_STATUS_ALL, 'searchModule' => '', 'statusModule' => -1, 'groupID' => 0, 'tagID' => 0, ); $filter = get_parameter('filter', $default_filters); if (class_exists('TreeEnterprise')) { $tree = new TreeEnterprise($type, $rootType, $id, $rootID, $serverID, $childrenMethod); } else { $tree = new Tree($type, $rootType, $id, $rootID, $serverID, $childrenMethod); } $tree->setFilter($filter); echo json_encode(array('success' => 1, 'tree' => $tree->getArray())); return; } if ($getDetail) { require_once($config['homedir']."/include/functions_treeview.php"); $id = (int) get_parameter('id'); $type = (string) get_parameter('type'); $server = array(); if (defined ('METACONSOLE')) { $server_id = (int) get_parameter('serverID'); $server = metaconsole_get_servers($server_id); if (metaconsole_connect($server) != NOERR) return; } ob_clean(); if (!empty($id) && !empty($type)) { 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; } ?>