Index: openacs-4/packages/bookmarks/tcl/bookmarks-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/tcl/bookmarks-procs.tcl,v diff -u -N -r1.4.8.1 -r1.4.8.2 --- openacs-4/packages/bookmarks/tcl/bookmarks-procs.tcl 22 May 2004 05:32:14 -0000 1.4.8.1 +++ openacs-4/packages/bookmarks/tcl/bookmarks-procs.tcl 12 Jun 2004 07:24:20 -0000 1.4.8.2 @@ -256,3 +256,24 @@ end; } } + +ad_proc -private bm_close_js_brackets {prev_folder_p prev_lev lev} { + This helper function is used by the tree-dynamic.tcl page in + constructing the bookmark tree for the javascript page. +} { + set result "" + if {$prev_folder_p && ($prev_lev >= $lev)} { + # Empty folder. We need to add a fake bookmark to the folder or else + # it will not have a folder icon attached to it. + set i_str [string repeat "\t" $prev_lev] + append result "$i_str\t\['Empty folder']\n" + append result "$i_str],\n" + } + while {$prev_lev > $lev} { + set i_str [string repeat "\t" [expr $prev_lev - 1]] + append result "$i_str],\n" + incr prev_lev -1 + } + + return $result +}