# # Outputs an html file in the format used by netscape/mozilla # for it's bookmarks menu # # index.vuh created from the original registered proc # because registered procs seem not to play with server # 404s # Mark Aufflick (mark@pumptheory.com) # 26 September 2003 # $Id: index.vuh,v 1.1 2003/09/25 17:06:02 marka Exp $ set user_id [ad_maybe_redirect_for_registration] set package_id [ad_conn package_id] set root_folder_id [bm_get_root_folder_id $package_id $user_id] set name [db_string name " select first_names||' '||last_name as name from cc_users where user_id = :user_id"] set folder_list 0 db_foreach bm_info { } { if { [string equal $folder_list 0] } { lappend folder_list $parent_id } else { set previous_parent_id [lindex $folder_list [expr [llength $folder_list]-1]] if {$parent_id != $previous_parent_id} { set parent_location [lsearch -exact $folder_list $parent_id] if {$parent_location==-1} { lappend folder_list $parent_id append bookmark_html "

\n\n" } else { set drop [expr [llength $folder_list]-$parent_location] set folder_list [lrange $folder_list 0 $parent_location] for {set i 1} {$i<$drop} {incr i} { append bookmark_html "

\n\n" } } } elseif { [string equal $folder_p "t"] && [string equal $previous_folder_p "t"] } { # The previous folder was empty append bookmark_html "

\n

\n\n" } } if {$folder_p=="t"} { append bookmark_html "

$local_title

\n\n" } else { append bookmark_html "
$local_title\n\n" } set previous_folder_p $folder_p } set html " Bookmarks for $name

Bookmarks for $name

$bookmark_html

" doc_return 200 text/html $html