bm_folder_selection db owner_id bookmark_idWhat it does:
Creates an option list of all the folders a selected object may move to - the resultingDefined in: /web/philip/tcl/bookmarks-defs.tcl
Source code:
set folder_exclusion_clauses [list "owner_id = $owner_id" "folder_p = 't'"] set selection [ns_db 0or1row $db "select folder_p, parent_id, parent_sort_key, local_sort_key from bm_list where bookmark_id = $bookmark_id"] if { $selection != "" } { set_variables_after_query if { $folder_p == "t" } { # We cannot move folders to be their own children. lappend folder_exclusion_clauses "(parent_sort_key not like '$parent_sort_key$local_sort_key%' or parent_sort_key is null)" lappend folder_exclusion_clauses "bookmark_id <> $bookmark_id" } } else { set parent_id "" } set selection [ns_db select $db "select bookmark_id, local_title, lpad(' ', 6*(nvl(length(parent_sort_key),0)+3), ' ') as indentation from bm_list where [join $folder_exclusion_clauses " and "] order by parent_sort_key || local_sort_key"] if { $parent_id == "" } { set edit_form_option "<option value=\"\" selected>Top Level</option>\n" } else { set edit_form_option "<option value=\"\" > Top Level </option>\n" } set folder_count 0 while {[ns_db getrow $db $selection]} { set_variables_after_query incr folder_count if { $bookmark_id == $parent_id } { append edit_form_option "<option value=$bookmark_id selected>$indentation $local_title </option>\n" } else { append edit_form_option "<option value=$bookmark_id>$indentation $local_title</option>\n" } } if {$folder_count > 8} { set size_count 8 } else { set size_count [expr $folder_count + 1] } return "<select size=$size_count name=parent_id>$edit_form_option</select>"