Index: openacs-4/packages/acs-subsite/lib/subsites.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/lib/subsites.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/lib/subsites.tcl 2 Oct 2003 22:04:46 -0000 1.3 +++ openacs-4/packages/acs-subsite/lib/subsites.tcl 2 Oct 2003 22:15:49 -0000 1.4 @@ -35,6 +35,11 @@ array set node [site_node::get_from_url -url $url -exact] if { [permission::permission_p -object_id $node(object_id) -privilege read] } { + # TODO + set edit_url {} + if { [permission::permission_p -object_id $node(object_id) -privilege admin] } { + set edit_url {} + } lappend subsites [list \ $node(instance_name) \ $node(node_id) \ Index: openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl,v diff -u -N -r1.12 -r1.13 --- openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl 1 Oct 2003 14:01:32 -0000 1.12 +++ openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl 2 Oct 2003 22:15:49 -0000 1.13 @@ -613,7 +613,7 @@ return $pageflow } -ad_proc subsite::main_site_id {} { +ad_proc -public subsite::main_site_id {} { Get the package_id of the Main Site. The Main Site is the subsite that is always mounted at '/' and that has a number of site-wide parameter settings. @@ -624,3 +624,24 @@ return $main_node(object_id) } + + +ad_proc -public subsite::get_template_options {} { + Gets options for subsite master template for use with a form builder select widget. +} { + 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 -package_id [ad_conn subsite_id]] + 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] + } + return $master_template_options +} Index: openacs-4/packages/acs-subsite/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/index.adp,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/acs-subsite/www/admin/index.adp 22 Sep 2003 08:40:04 -0000 1.17 +++ openacs-4/packages/acs-subsite/www/admin/index.adp 2 Oct 2003 22:15:49 -0000 1.18 @@ -1,5 +1,4 @@ -@context;noquote@

@subsite_name@ Administration

Advanced Features

Index: openacs-4/packages/acs-subsite/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/index.tcl,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/acs-subsite/www/admin/index.tcl 17 Sep 2003 12:13:25 -0000 1.10 +++ openacs-4/packages/acs-subsite/www/admin/index.tcl 2 Oct 2003 22:15:49 -0000 1.11 @@ -29,12 +29,9 @@ set acs_lang_admin_url "[apm_package_url_from_key "acs-lang"]admin/" +if { [string equal [ad_conn package_url] "/"] } { + set subsite_label "community" +} else { + set subsite_label "subcommunity" +} - -# Dirk: temporary fix for noquote hacking -set acs_admin_available_p 1 -set instance_name "foobar" - -set context {} - -ad_return_template 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 -N -r1.4 -r1.5 --- openacs-4/packages/acs-subsite/www/admin/subsite-add.tcl 2 Oct 2003 21:15:33 -0000 1.4 +++ openacs-4/packages/acs-subsite/www/admin/subsite-add.tcl 2 Oct 2003 22:15:49 -0000 1.5 @@ -7,32 +7,16 @@ node_id:integer,optional } -if ([string equal [ad_conn package_url] "/"]) { +if { [string equal [ad_conn package_url] "/"] } { set page_title "New community" set subsite_pretty_name "Community name" } else { set page_title "New subcommunity" set subsite_pretty_name "Subcommunity name" } -set context [list [list "." "Communities"] $page_title] +set context [list $page_title] -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 @@ -48,7 +32,7 @@ {master_template:text(select) {label "Template"} {help_text "Choose the layout and navigation you want for your community."} - {options $master_template_options} + {options [subsite::get_template_options]} } } -on_submit { set folder [site_node::verify_folder_name \