Index: openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 20 Jan 2002 19:20:11 -0000 1.19 +++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 23 Jan 2002 05:09:32 -0000 1.20 @@ -45,6 +45,12 @@ return "dotLRN Calendar" } + ad_proc -public get_user_default_page {} { + return the user default page to add the portlet to + } { + return [ad_parameter -package_id [apm_package_id_from_key dotlrn-calendar] user_default_page] + } + ad_proc -public add_applet { } { Called for one time init - must be repeatable! @@ -90,6 +96,10 @@ [portal::add_element $portal_template_id \ [calendar_portlet::my_name]] + # set the group_calendar_id parameter in the portal template, + portal::set_element_param \ + $element_id "group_calendar_id" $group_calendar_id + # Add the admin portlet, too set admin_portal_id \ [dotlrn_community::get_community_admin_portal_id $community_id] @@ -100,10 +110,6 @@ [portal::add_element $admin_portal_id \ [calendar_admin_portlet::my_name]] - # set the group_calendar_id parameter in the portal template, - portal::set_element_param \ - $element_id "group_calendar_id" $group_calendar_id - # automount calendar in this community set node_id [site_nodes::get_node_id_from_url \ -url [dotlrn_community::get_url_from_package_id \ @@ -191,7 +197,9 @@ calendar_portlet::make_self_available $portal_id # Call the portal element to be added correctly - calendar_portlet::add_self_to_page $portal_id $g_cal_id + calendar_portlet::add_self_to_page \ + -page_id [portal::get_page_id -portal_id $portal_id -page_name [get_user_default_page]] \ + $portal_id $g_cal_id # Now for the user workspace # set this calendar_id in the workspace portal