Index: openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl,v diff -u -r1.31.2.1 -r1.31.2.1.4.1 --- openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 11 Feb 2004 16:06:51 -0000 1.31.2.1 +++ openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 30 Jun 2004 21:22:02 -0000 1.31.2.1.4.1 @@ -65,6 +65,7 @@ Add the static applet to dotlrn - for one-time init Must be repeatable! } { + if {![dotlrn_applet::applet_exists_p -applet_key [applet_key]]} { db_transaction { @@ -94,19 +95,29 @@ } { Add the static applet to a dotlrn community } { + # set up admin portlet set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] static_admin_portlet::add_self_to_page \ -portal_id $admin_portal_id \ -package_id $community_id set portal_id [dotlrn_community::get_portal_id -community_id $community_id] + set args [ns_set create] - ns_set put $args "package_id" $community_id - ns_set put $args "template_id" [portal::get_portal_template_id $portal_id] + set template_id [portal::get_portal_template_id $portal_id] + + if {[empty_string_p $template_id]} { + + set template_id $portal_id + } + + ns_set put $args "package_id" $community_id + ns_set put $args "template_id" $template_id + set new_content_id [add_portlet_helper $portal_id $args] - + # the non-member portal uses the returned content_id from # the main page above to create a linked static portlet set n_p_id [dotlrn_community::get_non_member_portal_id \ @@ -228,7 +239,8 @@ args } { } { - return [static_portal_content::add_to_portal \ + + return [static_portal_content::add_to_portal \ -portal_id $portal_id \ -package_id [ns_set get $args "package_id"] \ -content_id [ns_set get $args "content_id"] \ Index: openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl,v diff -u -r1.16 -r1.16.6.1 --- openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl 23 Sep 2003 17:46:59 -0000 1.16 +++ openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl 30 Jun 2004 21:26:52 -0000 1.16.6.1 @@ -48,6 +48,7 @@ } { This is a bit different from other add_self_to_page procs. } { + if {![empty_string_p $template_id]} { # we got a template_id, so we know that (1) that we are # being called from add_applet_to_community. That means that