Index: openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl,v diff -u -r1.28 -r1.29 --- openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 29 Mar 2002 19:16:08 -0000 1.28 +++ openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 8 Apr 2002 22:00:46 -0000 1.29 @@ -25,45 +25,45 @@ # ad_library { - + Procs to set up the dotLRN Bboard applet - + @author ben@openforce.net,arjun@openforce.net @creation-date 2001-10-05 - + } namespace eval dotlrn_bboard { - + ad_proc -private my_package_key { } { return "dotlrn-bboard" } ad_proc -public applet_key {} { - get the applet key + get the applet key } { - return "dotlrn_bboard" + return "dotlrn_bboard" } ad_proc -public package_key { } { - get the package_key this applet deals with + get the package_key this applet deals with } { - return "sloan-bboard" + return "sloan-bboard" } ad_proc -public get_pretty_name { } { - returns the pretty name + returns the pretty name } { - return "dotLRN Discussion Forums" + return "dotLRN Discussion Forums" } ad_proc -public add_applet { } { - Add the bboard applet to dotlrn - for one-time init - Must be repeatable! + Add the bboard applet to dotlrn - for one-time init + Must be repeatable! } { # register/activate self with dotlrn # our service contract is in the db, but we must tell dotlrn @@ -75,15 +75,15 @@ } ad_proc -public add_applet_to_community { - community_id + community_id } { - Add the bboard applet to a dotlrn community + Add the bboard applet to a dotlrn community } { - # Create and Mount - set package_key [package_key] - set package_id [dotlrn::instantiate_and_mount -mount_point "forums" $community_id $package_key] + # Create and Mount + set package_key [package_key] + set package_id [dotlrn::instantiate_and_mount -mount_point "forums" $community_id $package_key] - + set auto_create_forum_p [ad_parameter \ -package_id [apm_package_id_from_key [my_package_key]] \ "auto_create_forum_p" "f"] @@ -92,89 +92,86 @@ -package_id [apm_package_id_from_key [my_package_key]] \ "auto_create_forum_name" "Discussions"] - if {$auto_create_forum_p == "t"} { + if {$auto_create_forum_p == "t"} { # set up a forum inside that instance, with context set to the - # package ID of the bboard package + # package ID of the bboard package bboard_forum_new -bboard_id $package_id \ -short_name $auto_create_forum_name \ -context_id $package_id } - # get the portal_template_id by callback - set pt_id [dotlrn_community::get_portal_template_id $community_id] + # get the portal_template_id by callback + set pt_id [dotlrn_community::get_portal_template_id $community_id] - # set up the DS for the portal template - bboard_portlet::make_self_available $pt_id - bboard_portlet::add_self_to_page $pt_id $package_id + # set up the DS for the portal template + bboard_portlet::make_self_available $pt_id + bboard_portlet::add_self_to_page $pt_id $package_id # set up the DS for the admin page set admin_portal_id [dotlrn_community::get_community_admin_portal_id $community_id] bboard_admin_portlet::make_self_available $admin_portal_id bboard_admin_portlet::add_self_to_page $admin_portal_id $package_id - # Set up permissions for basic members (Admins inherit no problem) - set members [dotlrn_community::get_rel_segment_id -community_id $community_id -rel_type dotlrn_member_rel] - ad_permission_grant $members $package_id bboard_read_forum - ad_permission_grant $members $package_id bboard_read_category - ad_permission_grant $members $package_id bboard_read_message - ad_permission_grant $members $package_id bboard_create_message + # Set up permissions for basic members (Admins inherit no problem) + set members [dotlrn_community::get_rel_segment_id -community_id $community_id -rel_type dotlrn_member_rel] + ad_permission_grant $members $package_id bboard_read_forum + ad_permission_grant $members $package_id bboard_read_category + ad_permission_grant $members $package_id bboard_read_message + ad_permission_grant $members $package_id bboard_create_message - # return the package_id - return $package_id + # return the package_id + return $package_id } ad_proc -public remove_applet { - community_id - package_id + community_id + package_id } { - remove the applet from the community + remove the applet from the community } { - # Dropping all messages, forums + # Dropping all messages, forums - # Killing the package - + # Killing the package + } ad_proc -public add_user { - community_id + community_id } { - Called when the user is initially added as a dotlrn user. - For one-time init stuff - + Called when the user is initially added as a dotlrn user. + For one-time init stuff } { - } - ad_proc -public add_user_to_community { - community_id - user_id + community_id + user_id } { - Add a user to a specific dotlrn community + Add a user to a specific dotlrn community } { - # Get the portal_id by callback - set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - - # Get the package_id by callback - set package_id [dotlrn_community::get_applet_package_id $community_id dotlrn_bboard] + # Get the portal_id by callback + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - # Allow user to see the bboard forums - # nothing for now + # Get the package_id by callback + set package_id [dotlrn_community::get_applet_package_id $community_id dotlrn_bboard] - # Make bboard DS available to this page - bboard_portlet::make_self_available $portal_id + # Allow user to see the bboard forums + # nothing for now - # Call the portal element to be added correctly - set element_id [bboard_portlet::add_self_to_page $portal_id $package_id] + # Make bboard DS available to this page + bboard_portlet::make_self_available $portal_id + # Call the portal element to be added correctly + set element_id [bboard_portlet::add_self_to_page $portal_id $package_id] + # Make sure that the group name is not displayed here portal::set_element_param $element_id "display_group_name_p" "f" - # Now for the user workspace - set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] + # Now for the user workspace + set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] - # Add the portlet here - if { $workspace_portal_id != "" } { + # Add the portlet here + if { $workspace_portal_id != "" } { set element_id [bboard_portlet::add_self_to_page $workspace_portal_id $package_id] # Make sure that the group name IS displayed here @@ -189,33 +186,33 @@ } ad_proc -public remove_user_from_community { - community_id - user_id + community_id + user_id } { - Remove a user from a community + Remove a user from a community } { - # Get the portal_id - set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - - # Get the package_id by callback - set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]] + # Get the portal_id + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - # Remove the portal element - bboard_portlet::remove_self_from_page $portal_id $package_id + # Get the package_id by callback + set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]] - # Buh Bye. - bboard_portlet::make_self_unavailable $portal_id + # Remove the portal element + bboard_portlet::remove_self_from_page $portal_id $package_id - # remove user permissions to see bboards - # nothing to do here + # Buh Bye. + bboard_portlet::make_self_unavailable $portal_id - # Remove from the main workspace - set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] + # remove user permissions to see bboards + # nothing to do here - # Remove the portlet here + # Remove from the main workspace + set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] + + # Remove the portlet here if { $workspace_portal_id != "" } { bboard_portlet::remove_self_from_page $workspace_portal_id $package_id } } - + } 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.39 -r1.40 --- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 2 Apr 2002 06:13:47 -0000 1.39 +++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 8 Apr 2002 22:00:46 -0000 1.40 @@ -23,46 +23,46 @@ # ad_library { - + Procs to set up the dotLRN calendar applet - + @author ben@openforce.net,arjun@openforce.net @creation-date 2001-10-26 - + } namespace eval dotlrn_calendar { - + ad_proc -public package_key { } { - get the package_key this applet deals with + get the package_key this applet deals with } { - return "calendar" + return "calendar" } ad_proc -public applet_key {} { return "dotlrn_calendar" } - + ad_proc -public get_url { } { - get the package_key this applet deals with + get the package_key this applet deals with } { - return "/[package_key]" + return "/[package_key]" } ad_proc portal_element_key { } { - return the portal element key + return the portal element key } { - return "calendar-portlet" + return "calendar-portlet" } ad_proc -public get_pretty_name { } { - returns the pretty name + returns the pretty name } { - return "Calendar" + return "Calendar" } ad_proc -public get_user_default_page {} { @@ -73,17 +73,17 @@ ad_proc -public add_applet { } { - Called for one time init - must be repeatable! - @return new pkg_id or 0 on failure + Called for one time init - must be repeatable! + @return new pkg_id or 0 on failure } { - # FIXME: won't work with multiple dotlrn instances + # FIXME: won't work with multiple dotlrn instances # Use the package_key for the -url param - "/" are not allowed! - if {![dotlrn::is_package_mounted -package_key [package_key]]} { + if {![dotlrn::is_package_mounted -package_key [package_key]]} { dotlrn::mount_package \ -package_key [package_key] \ -url [package_key] \ -directory_p "t" - } + } # register/activate self with dotlrn # our service contract is in the db, but we must tell dotlrn @@ -92,36 +92,36 @@ } ad_proc -public add_applet_to_community { - community_id + community_id } { - Add the calendar applet to a specific dotlrn community + Add the calendar applet to a specific dotlrn community } { - # set up a nice name for the comm's calendar - set cal_name "[dotlrn_community::get_community_name $community_id] Public Calendar" + # set up a nice name for the comm's calendar + set cal_name "[dotlrn_community::get_community_name $community_id] Public Calendar" - # create the community's calendar, the "f" is for a public calendar - set group_calendar_id \ - [calendar_create [ad_conn "user_id"] "f" $cal_name] + # create the community's calendar, the "f" is for a public calendar + set group_calendar_id \ + [calendar_create [ad_conn "user_id"] "f" $cal_name] - # add this element to the portal template. - # do this directly, don't use calendar_portlet::add_self_to_page here - set portal_template_id \ - [dotlrn_community::get_portal_template_id $community_id] - - calendar_portlet::make_self_available $portal_template_id + # add this element to the portal template. + # do this directly, don't use calendar_portlet::add_self_to_page here + set portal_template_id \ + [dotlrn_community::get_portal_template_id $community_id] - set element_id \ + calendar_portlet::make_self_available $portal_template_id + + set element_id \ [portal::add_element \ - -pretty_name [get_pretty_name] \ + -pretty_name [get_pretty_name] \ -force_region 2 \ $portal_template_id \ [calendar_portlet::my_name]] - # set the group_calendar_id parameter in the portal template, - portal::set_element_param \ - $element_id "calendar_id" $group_calendar_id + # set the group_calendar_id parameter in the portal template, + portal::set_element_param \ + $element_id "calendar_id" $group_calendar_id - # add the "full calendar" portlet to the commnuity's "calendar" page, + # add the "full calendar" portlet to the commnuity's "calendar" page, # similar to the same thing on a user's wsp. use the get_user_def_page # func here too set page_id [portal::get_page_id \ @@ -132,90 +132,90 @@ set element_id [calendar_full_portlet::add_self_to_page \ -page_id $page_id \ $portal_template_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] + set admin_portal_id \ + [dotlrn_community::get_community_admin_portal_id $community_id] - calendar_admin_portlet::make_self_available $admin_portal_id + calendar_admin_portlet::make_self_available $admin_portal_id - set element_id \ - [portal::add_element $admin_portal_id \ - [calendar_admin_portlet::my_name]] + set element_id \ + [portal::add_element $admin_portal_id \ + [calendar_admin_portlet::my_name]] - # set the group_calendar_id parameter in the admin portal. - portal::set_element_param \ - $element_id "calendar_id" $group_calendar_id - + # set the group_calendar_id parameter in the admin portal. + portal::set_element_param \ + $element_id "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 \ -package_id [dotlrn_community::get_package_id $community_id]]] - + set package_id [dotlrn::mount_package \ -parent_node_id $node_id \ -package_key [package_key] \ -url [package_key] \ -directory_p "t"] - + # Becase the context_id of calendar dosen't point to the community # the calendar_admin perm is not automatically inherited (like # in bboard for example) We must do an explicit grant to the # dotlrn_admin_rel relational segment. dotlrn_ta_rel and dotlrn_instructor_rel # both inherit from the dotlrn_admin_rel, so we don't have to grant to them. - set admin_segment_id [dotlrn_community::get_rel_segment_id -community_id $community_id -rel_type dotlrn_admin_rel] - ad_permission_grant $admin_segment_id $group_calendar_id admin + set admin_segment_id [dotlrn_community::get_rel_segment_id -community_id $community_id -rel_type dotlrn_admin_rel] + ad_permission_grant $admin_segment_id $group_calendar_id admin # ns_log notice "aks16 granted" # same thing for reading, cause it's not granted by context_id (ben) set members_segment_id [dotlrn_community::get_rel_segment_id -community_id $community_id -rel_type dotlrn_member_rel] ad_permission_grant $members_segment_id $group_calendar_id read - return $group_calendar_id + return $group_calendar_id } ad_proc -public remove_applet { - community_id - package_id + community_id + package_id } { - remove the applet from the community + remove the applet from the community } { - # XXX + # XXX - # Remove all instances of the calendar portlet! (this is some - # serious stuff!) - # Dropping all messages, forums - # Killing the package + # Remove all instances of the calendar portlet! (this is some + # serious stuff!) + # Dropping all messages, forums + # Killing the package } ad_proc -public add_user { - user_id + user_id } { - Called once when a user is added as a dotlrn user + Called once when a user is added as a dotlrn user } { - # Check if there is a calendar ID - set calendar_id [calendar_have_private_p -return_id 1 $user_id] + # Check if there is a calendar ID + set calendar_id [calendar_have_private_p -return_id 1 $user_id] - if {$calendar_id == 0} { - # this is lame, but I can't find a proc to do this - set user_name [db_string user_name_select " - select first_names || ' ' || last_name as name - from persons - where person_id = :user_id - "] - - # create a private, global calendar for this user - set cal_name "$user_name's Personal Calendar" - set calendar_id [calendar_create $user_id "t" $cal_name] - } - - # add this PE to the user's workspace! - set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] + if {$calendar_id == 0} { + # this is lame, but I can't find a proc to do this + set user_name [db_string user_name_select " + select first_names || ' ' || last_name as name + from persons + where person_id = :user_id + "] - # Add the portlet here + # create a private, global calendar for this user + set cal_name "$user_name's Personal Calendar" + set calendar_id [calendar_create $user_id "t" $cal_name] + } + + # add this PE to the user's workspace! + set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] + + # Add the portlet here if { $workspace_portal_id != "" } { calendar_portlet::make_self_available $workspace_portal_id @@ -235,13 +235,13 @@ } ad_proc -public add_user_to_community { - community_id - user_id + community_id + user_id } { - Add a user to a community + Add a user to a community } { # Get the portal_id by callback - set portal_id [dotlrn_community::get_portal_id $community_id $user_id] + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] # get the group_calendar_id by callback set g_cal_id [portal::get_element_param \ @@ -250,18 +250,18 @@ [calendar_portlet::my_name]] 0] \ "calendar_id"] - # Make the calendar DS available to this page - calendar_portlet::make_self_available $portal_id + # Make the calendar DS available to this page + calendar_portlet::make_self_available $portal_id - # Call the portal element to be added correctly - calendar_portlet::add_self_to_page \ + # Call the portal element to be added correctly + calendar_portlet::add_self_to_page \ $portal_id $g_cal_id - # Now for the user workspace - # set this calendar_id in the workspace portal + # Now for the user workspace + # set this calendar_id in the workspace portal set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] - + # get the comm's calendar_id, and add it as a param to the # ws portal's calendar portal element if { $workspace_portal_id != "" } { @@ -274,10 +274,10 @@ # This means I have to go fix the way permissions are assigned # at applet creation time (ben) # - # aks debug + # aks debug # ns_log notice "aks13 $user_id $g_cal_id calendar_read" - # ad_permission_grant $user_id $g_cal_id calendar_read - # ad_permission_grant $user_id $g_cal_id calendar_show + # ad_permission_grant $user_id $g_cal_id calendar_read + # ad_permission_grant $user_id $g_cal_id calendar_show # ns_log notice "aks14 read + show granted to user $user_id and cal $g_cal_id" } @@ -287,27 +287,42 @@ } { Remove a user entirely } { - # FIXME: nothing for now + set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] + + if {![empty_string_p $workspace_portal_id]} { + set calendar_id [calendar_have_private_p -return_id 1 $user_id] + + calendar_portlet::remove_self_from_page $workspace_portal_id $calendar_id + + calendar_full_portlet::remove_self_from_page \ + -page_id [portal::get_page_id -portal_id $workspace_portal_id \ + -page_name [get_user_default_page]] \ + $workspace_portal_id \ + $calendar_id + + calendar_portlet::make_self_unavailable $workspace_portal_id + + } } ad_proc -public remove_user_from_community { - community_id - user_id + community_id + user_id } { - Remove a user from a community + Remove a user from a community } { - # Get the portal_id - set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - - # Get the package_id by callback - set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]] + # Get the portal_id + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - # Remove the portal element - calendar_portlet::remove_self_from_page $portal_id $package_id + # Get the package_id by callback + set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]] - # Buh Bye. - calendar_portlet::make_self_unavailable $portal_id + # Remove the portal element + calendar_portlet::remove_self_from_page $portal_id $package_id + # Buh Bye. + calendar_portlet::make_self_unavailable $portal_id + # Remove from main workspace set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] @@ -320,8 +335,8 @@ # # Some dotlrn_calendar specific procs - # - + # + ad_proc -public get_group_calendar_id { {-community_id:required} } { @@ -336,10 +351,8 @@ $portal_template_id \ [calendar_portlet::my_name]] - # [lindex element_ids 0] + # [lindex element_ids 0] return [portal::get_element_param $element_id "calendar_id"] } - - } Index: openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl,v diff -u -r1.22 -r1.23 --- openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 29 Mar 2002 19:17:45 -0000 1.22 +++ openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 8 Apr 2002 22:00:46 -0000 1.23 @@ -25,21 +25,21 @@ # ad_library { - + Procs to set up the dotLRN Faq applet - + @author ben@openforce.net,arjun@openforce.net @creation-date 2001-10-05 - + } namespace eval dotlrn_faq { - + ad_proc -public get_pretty_name { } { - get the pretty name + get the pretty name } { - return "dotLRN Frequently Asked Questions" + return "dotLRN Frequently Asked Questions" } ad_proc -public applet_key {} { @@ -48,102 +48,102 @@ ad_proc -public package_key { } { - get the package_key this applet deals with + get the package_key this applet deals with } { - return "faq" + return "faq" } ad_proc portal_element_key { } { - return the portal element key + return the portal element key } { - return "faq-portlet" + return "faq-portlet" } ad_proc -public add_applet { } { - Add the faq applet to dotlrn - one time init - must be repeatable! + Add the faq applet to dotlrn - one time init - must be repeatable! } { dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] } ad_proc -public add_applet_to_community { - community_id + community_id } { - Add the faq applet to a specifc community + Add the faq applet to a specifc community } { - # create the calendar package instance (all in one, I've mounted it) - set package_key [package_key] - set package_id [dotlrn::instantiate_and_mount $community_id $package_key] + # create the calendar package instance (all in one, I've mounted it) + set package_key [package_key] + set package_id [dotlrn::instantiate_and_mount $community_id $package_key] - # portal template stuff - # get the portal_template_id by callback - set pt_id [dotlrn_community::get_portal_template_id $community_id] + # portal template stuff + # get the portal_template_id by callback + set pt_id [dotlrn_community::get_portal_template_id $community_id] - # set up the DS for the portal template - faq_portlet::make_self_available $pt_id - faq_portlet::add_self_to_page $pt_id $package_id + # set up the DS for the portal template + faq_portlet::make_self_available $pt_id + faq_portlet::add_self_to_page $pt_id $package_id - # set up the DS for the admin page + # set up the DS for the admin page set admin_portal_id [dotlrn_community::get_community_admin_portal_id $community_id] - faq_admin_portlet::make_self_available $admin_portal_id - faq_admin_portlet::add_self_to_page $admin_portal_id $package_id + faq_admin_portlet::make_self_available $admin_portal_id + faq_admin_portlet::add_self_to_page $admin_portal_id $package_id - # Set up some permissions - # for FAQ, it's all good as is + # Set up some permissions + # for FAQ, it's all good as is - # return the package_id - return $package_id + # return the package_id + return $package_id } ad_proc -public remove_applet { - community_id - package_id + community_id + package_id } { - remove the applet from the community + remove the applet from the community } { - # Remove all instances of the faq portlet! (this is some serious stuff!) + # Remove all instances of the faq portlet! (this is some serious stuff!) - # Dropping all messages, forums + # Dropping all messages, forums - # Killing the package - + # Killing the package + } ad_proc -public add_user { - user_id + user_id } { - For one time user-specfic init + For one time user-specfic init } { - return + return } ad_proc -public add_user_to_community { - community_id - user_id + community_id + user_id } { - Called when a user is added to a specific dotlrn community + Called when a user is added to a specific dotlrn community } { - # Get the portal_id by callback - set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - - # Get the faq applet's package_id by callback - set package_id [dotlrn_community::get_applet_package_id $community_id dotlrn_faq] + # Get the portal_id by callback + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - # Allow user to see the faq forums - # nothing for now + # Get the faq applet's package_id by callback + set package_id [dotlrn_community::get_applet_package_id $community_id dotlrn_faq] - # Make faq DS available to this page - faq_portlet::make_self_available $portal_id + # Allow user to see the faq forums + # nothing for now - # Call the portal element to be added correctly - faq_portlet::add_self_to_page $portal_id $package_id + # Make faq DS available to this page + faq_portlet::make_self_available $portal_id - # Now for the user workspace - set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] + # Call the portal element to be added correctly + faq_portlet::add_self_to_page $portal_id $package_id - # Add the portlet here - if { $workspace_portal_id != "" } { + # Now for the user workspace + set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] + + # Add the portlet here + if { $workspace_portal_id != "" } { faq_portlet::add_self_to_page $workspace_portal_id $package_id } } @@ -155,23 +155,23 @@ } ad_proc -public remove_user_from_community { - community_id - user_id + community_id + user_id } { - Remove a user from a community + Remove a user from a community } { - # Get the portal_id - set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - - # Get the package_id by callback - set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]] + # Get the portal_id + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - # Remove the portal element - faq_portlet::remove_self_from_page $portal_id $package_id + # Get the package_id by callback + set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]] - # Buh Bye. - faq_portlet::make_self_unavailable $portal_id - + # Remove the portal element + faq_portlet::remove_self_from_page $portal_id $package_id + + # Buh Bye. + faq_portlet::make_self_unavailable $portal_id + # Remove from main workspace set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] @@ -180,5 +180,5 @@ faq_portlet::remove_self_from_page $workspace_portal_id $package_id } } - + } Index: openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl,v diff -u -r1.41 -r1.42 --- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 29 Mar 2002 19:18:25 -0000 1.41 +++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 8 Apr 2002 22:00:46 -0000 1.42 @@ -383,6 +383,34 @@ user_id } { } { + # get the user's portal + set portal_id [dotlrn::get_workspace_portal_id $user_id] + + if {![empty_string_p $portal_id]} { + + # get the root folder of this package instance + set package_key [package_key] + set package_id [db_string select_min_package_id { + select min(package_id) + from apm_packages + where package_key = :package_key + }] + + # set package_id [apm_package_id_from_key [package_key]] + set root_folder_id [fs::get_root_folder -package_id $package_id] + + # does this user already have a root folder? + set user_root_folder_id [fs::get_folder \ + -name [get_user_root_folder_name -user_id $user_id] \ + -parent_id $root_folder_id \ + ] + + if {![empty_string_p $user_root_folder_id]} { + fs_portlet::remove_self_from_page $portal_id $package_id $user_root_folder_id + } + + } + } ad_proc -public remove_user_from_community {