Index: openacs-4/packages/acs-subsite/www/admin/subsite-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/subsite-add.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/admin/subsite-add.tcl 2 Oct 2003 19:34:32 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/admin/subsite-add.tcl 2 Oct 2003 21:15:33 -0000 1.4 @@ -16,8 +16,23 @@ } set context [list [list "." "Communities"] $page_title] -set package_key acs-subsite +set master_template_options [list] +lappend master_template_options [list "Default" "/www/default-master"] +lappend master_template_options [list "Community" "/packages/acs-subsite/www/group-master"] +set current_master [parameter::get -parameter DefaultTemplate] +set found_p 0 +foreach elm $master_template_options { + if { [string equal $current_master [lindex $elm 1]] } { + set found_p 1 + break + } +} +if { !$found_p } { + lappend master_template [list $current_master $current_master] +} + + ad_form -name subsite -cancel_url . -form { {node_id:key} {instance_name:text @@ -30,6 +45,11 @@ {help_text "This should be a short string, all lowercase, with hyphens instead of spaces, whicn will be used in the URL of the new application. If you leave this blank, we will generate one for you from name of the application."} {html {size 30}} } + {master_template:text(select) + {label "Template"} + {help_text "Choose the layout and navigation you want for your community."} + {options $master_template_options} + } } -on_submit { set folder [site_node::verify_folder_name \ -parent_node_id [ad_conn node_id] \ @@ -43,7 +63,13 @@ } } -new_data { if { [catch { - site_node::instantiate_and_mount -parent_node_id [ad_conn node_id] -node_name $folder -package_name $instance_name -package_key $package_key + set new_package_id [site_node::instantiate_and_mount \ + -parent_node_id [ad_conn node_id] \ + -node_name $folder \ + -package_name $instance_name \ + -package_key acs-subsite] + + parameter::set_value -parameter DefaultMaster -package_id $new_package_id -value $master_template } errsmg] } { ad_return_error "Problem Creating Application" "We had a problem creating the community." }