Index: openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql 28 Jun 2002 15:12:29 -0000 1.17 +++ openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql 2 Jul 2002 19:40:00 -0000 1.18 @@ -123,15 +123,15 @@ select case when file_storage.get_content_type(i.item_id) = 'content_folder' - then 'index?folder_id=' - else 'file?file_id=' + then :folder_url || '?' || :extra_vars || '&folder_id=' + else :file_url || '?' || :extra_vars || '&file_id=' end || i.item_id, file_storage.get_title(i.item_id) from cr_items i where item_id not in (select i2.item_id from cr_items i2 connect by prior i2.parent_id = i2.item_id - start with i2.item_id = file_storage.get_root_folder([ad_conn package_id])) + start with i2.item_id = :root_folder_id) connect by prior i.parent_id = i.item_id start with item_id = :start_id order by level desc Index: openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql,v diff -u -N -r1.23 -r1.24 --- openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 28 Jun 2002 15:12:29 -0000 1.23 +++ openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 2 Jul 2002 19:40:00 -0000 1.24 @@ -112,12 +112,12 @@ select (case when file_storage__get_content_type(i.item_id) = 'content_folder' - then 'index?folder_id=' - else 'file?file_id=' + then :folder_url || '?folder_id=' + else :file_url || '?file_id=' end) || i.item_id, file_storage__get_title(i.item_id) from (select tree_ancestor_keys(cr_items_get_tree_sortkey(:start_id)) as tree_sortkey) parents, - (select tree_sortkey from cr_items where item_id = file_storage__get_root_folder([ad_conn package_id])) root, + (select tree_sortkey from cr_items where item_id = :root_folder_id) root, cr_items i where i.tree_sortkey = parents.tree_sortkey and i.tree_sortkey > root.tree_sortkey Index: openacs-4/packages/file-storage/tcl/file-storage-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs.tcl,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 28 Jun 2002 15:12:29 -0000 1.18 +++ openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 2 Jul 2002 19:40:00 -0000 1.19 @@ -148,14 +148,22 @@ # ad_proc fs_context_bar_list { + {-root_folder_id ""} {-final ""} + {-folder_url "index"} + {-file_url "file"} + {-extra_vars ""} item_id } { Constructs the list to be fed to ad_context_bar appropriate for item_id. If -final is specified, that string will be the last item in the context bar. Otherwise, the name corresponding to item_id will be used. } { + if {[empty_string_p $root_folder_id]} { + set root_folder_id [fs_get_root_folder] + } + if [empty_string_p $final] { set start_id [db_string parent_id " select parent_id from cr_items where item_id = :item_id"] @@ -166,23 +174,7 @@ set start_id $item_id } - set context_bar [db_list_of_lists context_bar " - select decode( - file_storage.get_content_type(i.item_id), - 'content_folder', - 'index?folder_id=', - 'file?file_id=' - ) || i.item_id, - file_storage.get_title(i.item_id) - from cr_items i - where item_id not in ( - select i2.item_id - from cr_items i2 - connect by prior i2.parent_id = i2.item_id - start with i2.item_id = file_storage.get_root_folder([ad_conn package_id])) - connect by prior i.parent_id = i.item_id - start with item_id = :start_id - order by level desc"] + set context_bar [db_list_of_lists context_bar {}] lappend context_bar $final