Index: openacs-4/contrib/packages/portal/tcl/portal-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/portal-procs.tcl,v diff -u -r1.30 -r1.31 --- openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 19 Jun 2004 00:59:22 -0000 1.30 +++ openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 20 Jun 2004 00:39:05 -0000 1.31 @@ -58,8 +58,7 @@ would make sense to only grant read to the party directly. @initialize_elements_p If true and template_id is set, initialize elements after copying. - @theme_name The theme to assign to this portal (defaults to the package's - default_theme_name) + @theme_name The theme to assign to this portal (unless copying from a template) @package_id The package id of the owning package (defaults to ad_conn package_id) } { @@ -72,8 +71,10 @@ set context_id $package_id } - if { [string equal $theme_name ""] } { - set theme_name [parameter::get -parameter DefaultThemeName] + if { [string equal $template_id ""] } { + set theme_id [portal::theme::get_id -name $theme_name] + } else { + set theme_id [portal::get_theme_id -portal_id $template_id] } db_transaction { @@ -83,7 +84,7 @@ {p_template_id $template_id} {p_context_id $context_id} {p_owner_id $owner_id} - {p_theme_id [portal::theme::get_id -name $theme_name]} + {p_theme_id $theme_id} {p_package_id $package_id}}] set portal_id [package_instantiate_object -var_list $var_list portal] @@ -92,7 +93,7 @@ permission::grant -party_id $owner_id -object_id $portal_id -privilege $privilege } - if {[empty_string_p $template_id]} { + if {[string equal $template_id ""]} { foreach page $page_list { portal::page::new \ -portal_id $portal_id \ @@ -598,6 +599,7 @@ set master_portal_id [portal::new \ -name "Shared Portal" \ -owner_id 0 \ + -theme_name [parameter::get -parameter DefaultThemeName] \ -owner_privileges {}] # create the admin template @@ -606,24 +608,20 @@ -name "Portal Administration" \ -owner_id $package_id \ -page_list {{"Portal Administration" 2_column}} \ + -theme_name [parameter::get -parameter DefaultThemeName] \ -owner_privileges {}] db_foreach select_portal_datasources {} { - if { $admin_p } { - set element_id [portal::element::new \ - -portal_id $admin_portal_id \ - -datasource_name $name] + portal::element::new \ + -portal_id $admin_portal_id \ + -datasource_name $name } else { - set element_id [portal::element::new \ - -portal_id $master_portal_id \ - -state hidden \ - -datasource_name $name] + portal::element::new \ + -portal_id $master_portal_id \ + -state hidden \ + -datasource_name $name } - - portal::element::initialize \ - -datasource_name $name \ - -element_id $element_id } } }