'', 'statusAgent' => AGENT_STATUS_ALL, 'searchModule' => '', 'statusModule' => AGENT_MODULE_STATUS_ALL, 'groupID' => 0, 'tagID' => 0, ]; $filter = get_parameter('filter', $default_filters); $agent_a = check_acl($config['id_user'], 0, 'AR'); $agent_w = check_acl($config['id_user'], 0, 'AW'); $access = ($agent_a === true) ? 'AR' : (($agent_w === true) ? 'AW' : 'AR'); $switch_type = (empty($rootType) === false) ? $rootType : $type; switch ($switch_type) { case 'os': $tree = new TreeOS( $type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access ); break; case 'module_group': $tree = new TreeModuleGroup( $type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access ); break; case 'module': $tree = new TreeModule( $type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access ); break; case 'tag': $tree = new TreeTag( $type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access ); break; case 'group': if (is_metaconsole() === true) { if (class_exists('TreeGroupMeta') === false) { break; } $tree = new TreeGroupMeta( $type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access ); } else { $tree = new TreeGroup( $type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access ); } break; case 'policies': if (class_exists('TreePolicies') === false) { break; } $tree = new TreePolicies( $type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access ); break; case 'group_edition': $tree = new TreeGroupEdition( $type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access ); break; case 'services': $tree = new TreeService( $type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access, $metaID ); break; case 'IPAM_supernets': $tree = new TreeIPAMSupernet( $type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access ); break; default: // No error handler. return; } $tree->setFilter($filter); ob_clean(); echo json_encode(['success' => 1, 'tree' => $tree->getArray()]); return; } if ($getDetail === true) { include_once $config['homedir'].'/include/functions_treeview.php'; $id = (int) get_parameter('id'); $type = (string) get_parameter('type'); $server = []; if (is_metaconsole() === true) { $server_id = (int) get_parameter('serverID'); $server = metaconsole_get_servers($server_id); } ob_clean(); echo ''; echo '