Index: openacs-4/contrib/packages/bcms-ui-base/resources/folder-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/resources/folder-form.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/bcms-ui-base/resources/folder-form.tcl 27 Aug 2003 17:33:49 -0000 1.1 +++ openacs-4/contrib/packages/bcms-ui-base/resources/folder-form.tcl 27 Oct 2003 10:17:21 -0000 1.2 @@ -1,16 +1,13 @@ -ad_page_contract { - a form to create or edit a folder +# a form to create or edit a folder +# +# this file is meant to be included with the following parameters +# +# folder_id - if you are editing a folder +# parent_id - if you are creating a folder +# create_index_p - if true will create a blank page named "index" on the new folder, defaults to true +# return_url - requires a return_url, so after creating or editing a folder it redirect to this url +# form_mode - either "edit" or "display" - this file is meant to be included with the following parameters - - folder_id - if you are editing a folder - parent_id - if you are creating a folder - create_index_p - if true will create a blank page named "index" on the new folder, defaults to true - return_url - requires a return_url, so after creating or editing a folder it redirect to this url - -} { -} - # initialize the vars that don't exist if {![info exists parent_id]} { if {![info exists folder_id]} { @@ -21,8 +18,11 @@ if {![info exists create_index_p]} { set create_index_p true } +if {![info exists form_mode]} { + set form_mode edit +} -ad_form -name simpleform -form { +ad_form -name simpleform -mode $form_mode -form { folder_id:key @@ -42,6 +42,11 @@ bcms::folder::set_folder -folder_id $folder_id -name $folder_name -label $folder_label + if {[info exists folder_name]} { + # we have renamed the folder, we need to redirect on the new name + bcms::ui::base::redirect_after_rename -item_id $folder_id + } + } -new_data { set creation_user_id [ad_conn user_id]