Index: openacs-4/packages/file-storage/file-storage.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/file-storage.info,v diff -u -r1.9 -r1.10 --- openacs-4/packages/file-storage/file-storage.info 22 Feb 2002 19:06:28 -0000 1.9 +++ openacs-4/packages/file-storage/file-storage.info 22 Feb 2002 21:37:12 -0000 1.10 @@ -78,6 +78,8 @@ + + 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 -r1.5 -r1.6 --- openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql 22 Feb 2002 19:06:28 -0000 1.5 +++ openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql 22 Feb 2002 21:37:12 -0000 1.6 @@ -73,6 +73,30 @@ + + + select count(*) + from ( + select 1 + from cr_items, + cr_revisions, + acs_objects + where cr_items.parent_id = :folder_id + and cr_items.content_type = 'file_storage_object' + and 't' = acs_permission.permission_p(cr_items.item_id, :user_id, 'read') + and cr_items.item_id = acs_objects.object_id + and cr_items.live_revision = cr_revisions.revision_id(+) + union + select 1 + from cr_items, + cr_folders + where cr_items.parent_id = :folder_id + and cr_items.item_id = cr_folders.folder_id + and 't' = acs_permission.permission_p(cr_folders.folder_id, :user_id, 'read') + ) foo + + + 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 -r1.12 -r1.13 --- openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 22 Feb 2002 19:06:28 -0000 1.12 +++ openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 22 Feb 2002 21:37:12 -0000 1.13 @@ -61,6 +61,26 @@ + + + select count(*) + from ( + select 1 + from cr_items i left join cr_revisions r on (i.live_revision = r.revision_id), acs_objects o + where i.item_id = o.object_id + and i.parent_id = :folder_id + and acs_permission__permission_p(i.item_id, :user_id, 'read') = 't' + and i.content_type = 'file_storage_object' + union + select 1 + from cr_items i, cr_folders f + where i.item_id = f.folder_id + and i.parent_id = :folder_id + and acs_permission__permission_p(f.folder_id, :user_id, 'read') = 't' + ) foo + + + 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 -r1.8 -r1.9 --- openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 22 Feb 2002 19:06:28 -0000 1.8 +++ openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 22 Feb 2002 21:37:12 -0000 1.9 @@ -320,4 +320,21 @@ return [db_list_of_ns_sets get_folder_contents {}] } + ad_proc -public get_folder_contents_count { + {-folder_id:required} + {-user_id ""} + } { + Retrieve the count of contents of the specified folder. + + @param folder_id The folder for which to retrieve contents + @param user_id The viewer of the contents (to make sure they have + permission) + } { + if {[empty_string_p $user_id]} { + set user_id [acs_magic_object "the_public"] + } + + return [db_string get_folder_contents_count {}] + } + } Index: openacs-4/packages/file-storage/www/folder-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/folder-chunk.adp 22 Feb 2002 21:37:12 -0000 1.1 @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 NameActionSize (bytes)TypeModified
@contents.name@  Folder @contents.name@(download)@contents.content_size@@contents.type@@contents.last_modified@
+
+ +

Folder @folder_name@ is empty

+
Index: openacs-4/packages/file-storage/www/folder-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/file-storage/www/folder-chunk.tcl 22 Feb 2002 21:37:12 -0000 1.1 @@ -0,0 +1,28 @@ +# file-storage/www/folder-chunk.tcl + +ad_page_contract { + @author yon (yon@milliped.com) + @creation-date Feb 22, 2002 + @version $Id: folder-chunk.tcl,v 1.1 2002/02/22 21:37:12 yon Exp $ +} -query { +} -properties { + folder_name:onevalue + contents:multirow +} + +if {![exists_and_not_null folder_id]} { + return + ad_script_abort +} + +if {![exists_and_not_null viewing_user_id]} { + set viewing_user_id [acs_magic_object "the_public"] +} + +set folder_name [fs_get_folder_name $folder_id] + +template::util::list_of_ns_sets_to_multirow \ + -rows [fs::get_folder_contents -folder_id $folder_id -user_id $viewing_user_id] \ + -var_name "contents" + +ad_return_template Index: openacs-4/packages/file-storage/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/index.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/file-storage/www/index.adp 4 Dec 2001 04:59:48 -0000 1.5 +++ openacs-4/packages/file-storage/www/index.adp 22 Feb 2002 21:37:12 -0000 1.6 @@ -15,7 +15,7 @@ permissions on this folder

- +

  • Delete this folder @@ -25,36 +25,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameActionSize (bytes)TypeModified
    @file.name@  File Folder @file.name@(download)@file.content_size@@file.type@@file.last_modified@
    There are no items in this folder
    + Index: openacs-4/packages/file-storage/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/index.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/file-storage/www/index.tcl 22 Feb 2002 19:06:28 -0000 1.8 +++ openacs-4/packages/file-storage/www/index.tcl 22 Feb 2002 21:37:12 -0000 1.9 @@ -47,8 +47,6 @@ set package_id [ad_conn package_id] -template::util::list_of_ns_sets_to_multirow \ - -rows [fs::get_folder_contents -folder_id $folder_id -user_id $user_id] \ - -var_name "file" +set n_contents [fs::get_folder_contents_count -folder_id $folder_id -user_id $user_id] ad_return_template