xcatresponse->serverdone[0]); $numsubgroups=count($rvals->xcatresponse->intersectinggroups); $numnodes=count($rvals->xcatresponse->node); $jdata=array(); if ($numnodes >= $numsubgroups) { #If there are few enough subgroups to be helpful filters, add them in foreach ($rvals->xcatresponse->intersectinggroups as $group) { if (! in_array("$group",$parents)) { $jdata[]= array("data"=>"$group", "attributes"=>array("id"=>"$id$group", "rel"=>'group'), "state"=>'closed'); } } } #If there were more groups than nodes, leave the signal to noise ratio down if ($root==0) { foreach ($rvals->xcatresponse->node as $node) { $jdata[] = array("data"=>"$node", "attributes"=>array("id"=>",$node", "rel"=>'node')); } } # header('Content-type: text/html'); echo json_encode($jdata); ?>