Index: openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl 10 Dec 2001 21:38:42 -0000 1.19 +++ openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl 11 Dec 2001 05:46:15 -0000 1.20 @@ -120,34 +120,29 @@ where i.item_id = f.folder_id and i.parent_id = :my_folder_id and acs_permission.permission_p(:my_folder_id, :user_id, 'read') = 't' order by ordering_key,name" - - set list_of_folder_ids $config(folder_id) - - if {[llength $list_of_folder_ids] > 1} { - set folder_img_data "" - set file_img_data "" - } else { - set folder_img_data "" - set file_img_data "" - } set template "" if { $config(shaded_p) == "f" } { + set list_of_folder_ids $config(folder_id) + foreach my_folder_id $list_of_folder_ids { + set package_id [db_string get_package_id "select package_id from (select item_id from cr_items connect by prior parent_id = item_id start with item_id = :my_folder_id) this, fs_root_folders where item_id = folder_id"] + + set url [dotlrn_community::get_url_from_package_id -package_id $package_id] + set data "" set rowcount 0 db_foreach select_files_and_folders $query { if {$type == "Folder"} { - - append data "" + append data "" } else { set type "File" - append data "" + append data "" } append template "\n$data\n" } @@ -176,7 +171,7 @@ ad_proc -public remove_self_from_page { portal_id - community_id + instance_id } { Removes a fs PE from the given page @@ -191,7 +186,13 @@ # remove all elements db_transaction { foreach element_id $element_ids { - portal::remove_element $element_id + # Highly simplified (ben) + portal::remove_element_param_value -element_id $element_id -key instance_id -value $instance_id + + # Check if we should really remove the element + if {[llength [portal::get_element_param_list -element_id $element_id -key instance_id]] == 0} { + portal::remove_element $element_id + } } } }
$folder_img_data $name$type$num files
$name$type$num files
$file_img_data $name$type(download)
$name?version_id=$file_live_rev>(download)