<% Response.Buffer=true %> <% '----------------------------------------------------------- '-- FUNCTION TO WRITE IA TREE FOR GROUP ACCESS '----------------------------------------------------------- dim selectedNodes dim checkNode dim parent_id dim thisGroupAccess dim nodesToExpand parent_id = request("parent_id") thisGroupAccess = request("thisGroupAccess") nodesToExpand = request("nodesToExpand") call writeGroupAccessTree(parent_id,thisGroupAccess,nodesToExpand) function writeGroupAccessTree(parent_id,thisGroupAccess,nodesToExpand) dim thisNodeID selectedNodes = Split(thisGroupAccess,",") openNodes = Split(nodesToExpand,",") gtSQL= ""&_ "SELECT p.page_id, pi.page_title, "&_ "ia.ia_depth, ia.ia_parentid, "&_ "(SELECT count(ia.ia_childid) FROM ia ia WHERE ia.ia_parentid = p.page_id) as children "&_ "FROM pages p "&_ "INNER JOIN ia ia on p.page_id = ia.ia_childid "&_ "INNER JOIN page_info pi on p.page_id = pi.page_id "&_ "WHERE ia.ia_parentid = " & parent_id & " AND pi.language_ID = " & session("languageID") &_ " ORDER BY ia.ia_sortorder" set rs = LoadRSFromDB(gtSQL) if not rs.EOF then Do While not rs.EOF thisNodeID = rs("page_id") response.write("
" & VbCrLf) checkNode = false if cint(rs("children")) > 0 then if IDisInArray(thisNodeID,openNodes) then response.write("") else response.write("") end if else response.write("") end if thisNodesDescendants = collectDescendants(thisNodeID,"") thisNodesAncestors = collectAncestors(thisNodeID,"") response.write("

" & replace(rs("page_title")," & "," & ") & "

") response.write("

 

" & VbCrLf) response.write("
" & VbCrLf) if IDisInArray(thisNodeID, openNodes) then call writeGroupAccessTree(thisNodeID,thisGroupAccess,nodesToExpand) end if rs.moveNext loop end if rs.Close Set rs = Nothing end function function IDisInArray(c_ID,c_array) dim tempValue tempValue = false if isArray(c_array) then for n=0 to ubound(c_array) if len(c_array(n)) then if cint(c_array(n)) = cint(c_ID) then tempValue = true end if end if next end if IDisInArray = tempValue end function %>