Index: openacs-4/packages/file-storage/www/folder-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-delete.adp,v diff -u -r1.6 -r1.6.4.1 --- openacs-4/packages/file-storage/www/folder-delete.adp 13 Oct 2003 17:16:08 -0000 1.6 +++ openacs-4/packages/file-storage/www/folder-delete.adp 3 May 2004 01:35:14 -0000 1.6.4.1 @@ -8,19 +8,6 @@ - -
- - - -

#file-storage.lt_delete_folder# - -

-

- -
- -
- +
Index: openacs-4/packages/file-storage/www/folder-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-delete.tcl,v diff -u -r1.6 -r1.6.4.1 --- openacs-4/packages/file-storage/www/folder-delete.tcl 13 Oct 2003 17:16:08 -0000 1.6 +++ openacs-4/packages/file-storage/www/folder-delete.tcl 3 May 2004 01:35:14 -0000 1.6.4.1 @@ -21,12 +21,6 @@ } } - no_children -requires {not_root_folder} { - if { [db_string child_count " - select count(*) from cr_items where parent_id = :folder_id"] > 0 } { - ad_complain "[_ file-storage.lt_Were_sorry_but_at_the]" - } - } } -properties { folder_id:onevalue folder_name:onevalue @@ -43,16 +37,45 @@ # contents at all.) set blocked_p [ad_decode [children_have_permission_p $folder_id delete] 0 t f] +set folder_name [db_string folder_name ""] + +set child_count [db_string child_count ""] + +# TODO add child_count to message key + +set context [fs_context_bar_list -final "[_ file-storage.Delete]" $folder_id] + +set delete_message "[_ file-storage.delete_folder_and_children]" +set delete_label "[_ file-storage.Yes_Delete]" +ad_form -name folder-delete -export folder_id -form { + {delete_message:text(inform) {label ""} {value $delete_message}} + {submit:text(submit) {label $delete_label}} +} -on_request { + +} -on_submit { + if {[string equal $blocked_p "f"] } { + # they have confirmed that they want to delete the folder + + db_1row parent_id " + select parent_id from cr_items where item_id = :folder_id" + + db_exec_plsql folder_delete "" + + } + + ad_returnredirect "index?folder_id=$parent_id" + + ad_script_abort + +} + if { [string equal $confirmed_p "t"] && [string equal $blocked_p "f"] } { # they have confirmed that they want to delete the folder db_1row parent_id " select parent_id from cr_items where item_id = :folder_id" - db_exec_plsql folder_delete " - begin - file_storage.delete_folder(:folder_id); - end;" + db_exec_plsql folder_delete "" ad_returnredirect "index?folder_id=$parent_id" @@ -63,7 +86,7 @@ set folder_name [db_string folder_name " select label from cr_folders where folder_id = :folder_id"] - + set child_count [db_string child_count "select count(ci.item_id) from (select item_id from cr_items connect by prior item_id=parent_id start with item_id=:folder_id) ci"] set context [fs_context_bar_list -final "[_ file-storage.Delete]" $folder_id] }