Index: openacs-4/packages/file-storage/www/folder_list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/folder_list.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/file-storage/www/folder_list.tcl 20 Apr 2001 20:51:10 -0000 1.1 +++ openacs-4/packages/file-storage/www/folder_list.tcl 18 Aug 2001 15:52:02 -0000 1.2 @@ -1,11 +1,13 @@ set user_id [ad_conn user_id] +set package_id [ad_conn package_id] if ![empty_string_p $file_id] { - set children_clause "and item_id not in (select item_id - from cr_items - where item_id != :file_id - connect by prior item_id = parent_id - start with item_id = :file_id)" + set children_clause [db_map children_clause] + #"and item_id not in (select item_id + #from cr_items + #where item_id != :file_id + #connect by prior item_id = parent_id + #start with item_id = :file_id)" } else { set children_clause "" } @@ -14,15 +16,15 @@ # Should base the choice on performance tests. set sql " -select lpad('  ',12 * level,'  ') as spaces, + select lpad('  ',12 * level,'  ') as spaces, (select f.label from cr_folders f where f.folder_id = i.item_id) as label, (select f.folder_id from cr_folders f where f.folder_id = i.item_id) as new_parent -from cr_items i -where acs_permission.permission_p(i.item_id,:user_id,'write') = 't' -and exists (select 1 from cr_folders f where f.folder_id = i.item_id) -$children_clause -connect by prior item_id = parent_id -start with item_id = file_storage.get_root_folder([ad_conn package_id])" - + from cr_items i + where acs_permission.permission_p(i.item_id,:user_id,'write') = 't' + and exists (select 1 from cr_folders f where f.folder_id = i.item_id) + $children_clause + connect by prior item_id = parent_id + start with item_id = file_storage.get_root_folder(:package_id) +" db_multirow folder folder $sql