Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl,v diff -u -r1.64 -r1.65 --- openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 7 Mar 2005 21:26:33 -0000 1.64 +++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 10 Mar 2005 15:22:42 -0000 1.65 @@ -592,6 +592,30 @@ return [get -node_id $node(parent_id)] } +ad_proc -public site_node::get_ancestors { + {-node_id:required} + {-element ""} +} { + return the ancestors of this node +} { + set result [list] + set array_result_p [string equal $element ""] + + while {![string equal $node_id ""]} { + array set node [get -node_id $node_id] + + if {$array_result_p} { + lappend result [array get node] + } else { + lappend result $node($element) + } + + set node_id $node(parent_id) + } + + return $result +} + ad_proc -public site_node::get_object_id { {-node_id:required} } {