Index: openacs-4/packages/dotlrn/dotlrn.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v
diff -u -r1.52 -r1.53
--- openacs-4/packages/dotlrn/dotlrn.info 18 Feb 2002 01:53:31 -0000 1.52
+++ openacs-4/packages/dotlrn/dotlrn.info 22 Feb 2002 20:31:24 -0000 1.53
@@ -235,6 +235,8 @@
+
+
@@ -315,7 +317,7 @@
-
+
Index: openacs-4/packages/dotlrn/www/community-member.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-member.adp,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/dotlrn/www/community-member.adp 28 Jan 2002 21:57:52 -0000 1.4
+++ openacs-4/packages/dotlrn/www/community-member.adp 22 Feb 2002 20:31:25 -0000 1.5
@@ -46,6 +46,10 @@
+
Shared Files
+
+
+
@user_contributions.pretty_plural@
Index: openacs-4/packages/dotlrn/www/community-member.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-member.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/dotlrn/www/community-member.tcl 23 Jan 2002 01:15:10 -0000 1.3
+++ openacs-4/packages/dotlrn/www/community-member.tcl 22 Feb 2002 20:31:25 -0000 1.4
@@ -26,6 +26,7 @@
bio:onevalue
verified_user_id:onevalue
user_contributions:multirow
+ folder_id:onevalue
}
set verified_user_id [ad_verify_and_get_user_id]
@@ -105,6 +106,8 @@
creation_date
}
+set folder_id [dotlrn_fs::get_user_shared_folder -user_id $user_id]
+
set context_bar [ad_context_bar_ws_or_index "Community member"]
set system_name [ad_system_name]
set pretty_creation_date [util_AnsiDatetoPrettyDate $creation_date]
Index: openacs-4/packages/dotlrn/www/folder-chunk.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/folder-chunk.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn/www/folder-chunk.adp 22 Feb 2002 20:31:25 -0000 1.1
@@ -0,0 +1,35 @@
+
+
+
+ |
+ Name |
+ Action |
+ Size (bytes) |
+ Type |
+ Modified |
+
+
+
+
+ |
+ @contents.name@ |
+ |
+ |
+ Folder |
+ |
+
+
+ |
+ @contents.name@ |
+ (download) |
+ @contents.content_size@ |
+ @contents.type@ |
+ @contents.last_modified@ |
+
+
+
+
+
+
+ Folder @folder_name@ is empty
+
Index: openacs-4/packages/dotlrn/www/folder-chunk.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/folder-chunk.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn/www/folder-chunk.tcl 22 Feb 2002 20:31:25 -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 20:31:25 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/dotlrn-fs/tcl/dotlrn-fs-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl,v
diff -u -r1.29 -r1.30
--- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 21 Feb 2002 21:55:33 -0000 1.29
+++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 22 Feb 2002 20:31:57 -0000 1.30
@@ -150,6 +150,50 @@
return [db_string select_folder_id {} -default ""]
}
+ ad_proc -public get_user_root_folder_name {
+ {-user_id:required}
+ } {
+ Get the internal name for a user's root folder.
+ } {
+ return "dotlrn_fs_${user_id}_root_folder"
+ }
+
+ ad_proc -public get_user_root_folder {
+ {-user_id:required}
+ } {
+ Get the folder_id of a user's root folder.
+ } {
+ set name [get_user_root_folder_name -user_id $user_id]
+
+ return [db_string get_user_root_folder {
+ select item_id
+ from cr_items
+ where name = :name
+ } -default ""]
+ }
+
+ ad_proc -public get_user_shared_folder_name {
+ {-user_id:required}
+ } {
+ Get the internal name for a user's root folder.
+ } {
+ return "dotlrn_fs_${user_id}_shared_folder"
+ }
+
+ ad_proc -public get_user_shared_folder {
+ {-user_id:required}
+ } {
+ Get the folder_id of a user's shared folder.
+ } {
+ set name [get_user_shared_folder_name -user_id $user_id]
+
+ return [db_string get_user_root_folder {
+ select item_id
+ from cr_items
+ where name = :name
+ } -default ""]
+ }
+
ad_proc -public add_user {
user_id
} {
@@ -174,15 +218,15 @@
# does this user already have a root folder?
set user_root_folder_id [fs::get_folder \
- -name "${user_id}_folder" \
+ -name [get_user_root_folder_name -user_id $user_id] \
-parent_id $root_folder_id \
]
if {[empty_string_p $user_root_folder_id]} {
# create the user's root folder
set user_root_folder_id [fs::new_folder \
- -name "${user_id}_folder" \
+ -name [get_user_root_folder_name -user_id $user_id] \
-parent_id $root_folder_id \
-pretty_name "${user_name}'s Files" \
-creation_user $user_id \
@@ -209,24 +253,25 @@
-page_id $page_id $portal_id $package_id $user_root_folder_id
}
- # does this user already have a root folder?
+ # does this user already have a shared folder?
set user_shared_folder_id [fs::get_folder \
- -name "${user_id}_shared_folder" \
+ -name [get_user_shared_folder_name -user_id $user_id] \
-parent_id $user_root_folder_id \
]
if {[empty_string_p $user_shared_folder_id]} {
# create the user's shared folder
set user_shared_folder_id [fs::new_folder \
- -name "${user_id}_shared_folder" \
+ -name [get_user_shared_folder_name -user_id $user_id] \
-parent_id $user_root_folder_id \
-pretty_name "${user_name}'s Shared Files" \
-creation_user $user_id \
]
# set the permissions for this folder; only the user has access to it
- ad_permission_grant [dotlrn::get_full_users_rel_segment_id] $user_shared_folder_id "read"
+ # ad_permission_grant [dotlrn::get_full_users_rel_segment_id] $user_shared_folder_id "read"
+ ad_permission_grant [acs_magic_object "the_public"] $user_shared_folder_id "read"
}
}