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.44 -r1.45 --- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 17 Apr 2002 15:51:36 -0000 1.44 +++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 18 Apr 2002 19:24:47 -0000 1.45 @@ -80,6 +80,10 @@ # create the root folder for this instance set folder_id [fs::new_root_folder -package_id $package_id] + portal::mapping::new \ + -object_id $folder_id \ + -node_id [site_nodes::get_node_id_from_package_id -package_id $package_id] + set party_id [acs_magic_object "registered_users"] permission::grant -party_id $party_id -object_id $folder_id -privilege "read" permission::revoke -party_id $party_id -object_id $folder_id -privilege "write" @@ -128,10 +132,10 @@ if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { fs_portlet::add_self_to_page \ - -page_id $page_id \ - $pt_id \ - 0 \ - 0 + -page_id $page_id \ + $pt_id \ + 0 \ + 0 return } @@ -151,11 +155,14 @@ -description "${community_name}'s Files" \ ] + set node_id [site_nodes::get_node_id_from_package_id -package_id $package_id] + portal::mapping::new -object_id $folder_id -node_id $node_id + fs_portlet::add_self_to_page \ - -page_id $page_id \ - $pt_id \ - $package_id \ - $folder_id + -page_id $page_id \ + $pt_id \ + $package_id \ + $folder_id set party_id [acs_magic_object "registered_users"] permission::revoke -party_id $party_id -object_id $folder_id -privilege "read" @@ -183,10 +190,12 @@ set root_community_type [dotlrn_community::get_toplevel_community_type_from_community_id $community_id] foreach folder [string trim [split [ad_parameter -package_id [apm_package_id_from_key "dotlrn-fs"] "${root_community_type}_default_folders"] ',']] { - fs::new_folder \ + set a_folder_id [fs::new_folder \ -name $folder \ -pretty_name $folder \ - -parent_id $folder_id + -parent_id $folder_id] + + portal::mapping::new -object_id $a_folder_id -node_id $node_id } # Set up public folder @@ -196,6 +205,8 @@ -parent_id $folder_id \ ] + portal::mapping::new -object_id $public_folder_id -node_id $node_id + # The public folder is available to all dotLRN Full Access Users set dotlrn_public [dotlrn::get_full_users_rel_segment_id] permission::grant -party_id $dotlrn_public -object_id $public_folder_id -privilege "read" @@ -307,6 +318,8 @@ -parent_id $root_folder_id \ ] + set node_id [site_nodes::get_node_id_from_package_id -package_id $package_id] + if {[empty_string_p $user_root_folder_id]} { # create the user's root folder @@ -317,6 +330,8 @@ -creation_user $user_id \ ] + portal::mapping::new -object_id $user_root_folder_id -node_id $node_id + # set the permissions for this folder; only the user has access to it permission::set_not_inherit -object_id $user_root_folder_id permission::grant -party_id $user_id -object_id $user_root_folder_id -privilege "read" @@ -355,6 +370,8 @@ -creation_user $user_id \ ] + portal::mapping::new -object_id $user_shared_folder_id -node_id $node_id + # set the permissions for this folder permission::grant \ -party_id [acs_magic_object "the_public"] \ Index: openacs-4/packages/fs-portlet/www/fs-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/www/fs-portlet.adp,v diff -u -r1.7 -r1.8 --- openacs-4/packages/fs-portlet/www/fs-portlet.adp 4 Apr 2002 03:01:52 -0000 1.7 +++ openacs-4/packages/fs-portlet/www/fs-portlet.adp 18 Apr 2002 19:24:47 -0000 1.8 @@ -19,6 +19,43 @@ %> + + + + + + + + Upload a file to your personal folder + + | + + Create a URL in your personal folder + + + + + + + Create a new folder within your personal folder + + + + + + + + + + + Modify permissions on your personal folder + + + + + + + @@ -57,6 +94,7 @@ + Index: openacs-4/packages/fs-portlet/www/fs-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/www/fs-portlet.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/fs-portlet/www/fs-portlet.tcl 7 Apr 2002 01:13:29 -0000 1.5 +++ openacs-4/packages/fs-portlet/www/fs-portlet.tcl 18 Apr 2002 19:24:47 -0000 1.6 @@ -21,14 +21,58 @@ @author Arjun Sanyal (arjun@openforce.net) @cvs_id $Id$ +} -query { + {n_past_days "-1"} } -properties { + user_id:onevalue + user_root_folder:onevalue + user_root_folder_present_p:onevalue + write_p:onevalue + admin_p:onevalue + delete_p:onevalue + url:onevalue folders:multirow } array set config $cf set user_id [ad_conn user_id] set list_of_folder_ids $config(folder_id) +set user_root_folder [dotlrn_fs::get_user_root_folder -user_id $user_id] +set user_root_folder_present_p 0 +set write_p 0 +set admin_p 0 +set delete_p 0 +set url "" +if {![empty_string_p $user_root_folder] && [lsearch -exact $list_of_folder_ids $user_root_folder] != -1} { + set user_root_folder_present_p 1 + + set write_p [permission::permission_p -object_id $user_root_folder -privilege "write"] + set admin_p [permission::permission_p -object_id $user_root_folder -privilege "admin"] + + set delete_p $admin_p + if {!$delete_p} { + set delete_p [permission::permission_p -object_id $user_root_folder -privilege "delete"] + } + + set url [portal::mapping::get_url -object_id $user_root_folder] +} + +form create n_past_days_form + +set options {{0 -1} {1 1} {2 2} {3 3} {7 7} {14 14} {30 30}} +element create n_past_days_form n_past_days \ + -label "" \ + -datatype text \ + -widget select \ + -options $options \ + -html {onChange document.n_past_days_form.submit()} \ + -value $n_past_days + +if {[form is_valid n_past_days_form]} { + form get_values n_past_days_form n_past_days +} + db_multirow folders select_fs_objects {} ad_return_template