Index: openacs-4/packages/ajax-filestorage-ui/www/xmlhttp/get-foldercontents.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-filestorage-ui/www/xmlhttp/get-foldercontents.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ajax-filestorage-ui/www/xmlhttp/get-foldercontents.tcl 26 Nov 2007 12:52:45 -0000 1.1 +++ openacs-4/packages/ajax-filestorage-ui/www/xmlhttp/get-foldercontents.tcl 13 Dec 2007 05:33:42 -0000 1.2 @@ -10,6 +10,7 @@ folder_id:optional tag_id:integer,optional {sort "fs_objects.title"} + {package_id:optional} {dir "DESC"} } @@ -23,6 +24,7 @@ # so that we can get a path to prefix to the files set root_package_id [ajaxfs::get_root_folder -folder_id $folder_id] +if {[info exists package_id]} { set root_package_id $package_id } set root_folder_id [fs::get_root_folder -package_id $root_package_id] set folder_name [lang::util::localize [fs::get_object_name -object_id $folder_id]] @@ -86,8 +88,10 @@ } -db_multirow -extend { filename icon last_modified_pretty content_size_pretty download_url object_counter file_list_start file_list_end write_p tags} contents $query_name $query { +db_multirow -extend { filename icon last_modified_pretty content_size_pretty download_url linkurl object_counter file_list_start file_list_end write_p tags symlink_id} contents $query_name $query { + set symlink_id "" + # title of the file if { ![exists_and_not_null title] } { set title $name } @@ -117,8 +121,40 @@ switch -- $type { folder { - set icon "" + set shared_with [db_list get_share_from "select p.instance_name + from cr_folders f, + cr_symlinks s, + cr_items i, + acs_objects o, + apm_packages p, + site_nodes s1, + site_nodes s2 + where o.package_id = s2.object_id + and s1.node_id = s2.parent_id + and s1.object_id = p.package_id + and s.symlink_id = o.object_id + and s.symlink_id = i.item_id + and s.target_id = :object_id + and f.folder_id=i.parent_id"] + if { [llength $shared_with] > 0} { + set shareditems [join ${shared_with} "