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.31 -r1.32 --- openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 13 May 2002 06:00:06 -0000 1.31 +++ openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 14 May 2002 21:42:16 -0000 1.32 @@ -154,7 +154,13 @@ set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]] set portal_id [dotlrn::get_workspace_portal_id $user_id] - faq_portlet::remove_self_from_page $portal_id $package_id + set args [ns_set create args] + ns_set put $args user_id $user_id + ns_set put $args community_id $community_id + ns_set put $args package_id $package_id + set list_args [list $portal_id $args] + + remove_portlet $portal_id $args } ad_proc -public add_portlet { @@ -170,15 +176,29 @@ } ad_proc -public remove_portlet { + portal_id args } { A helper proc to remove the underlying portlet from the given portal. - @param args a list-ified array of args defined in remove_applet_from_community - } { - ns_log notice "** Error in [get_pretty_name]: 'remove_portlet' not implemented!" - ad_return_complaint 1 "Please notifiy the administrator of this error: - ** Error in [get_pretty_name]: 'remove_portlet' not implemented!" + @param portal_id + @param args A list of key-value pairs (possibly user_id, community_id, and more) + } { + set user_id [ns_set get $args "user_id"] + set community_id [ns_set get $args "community_id"] + + if {![empty_string_p $user_id]} { + # the portal_id is a user's portal + set faq_pacakge_id [ns_set get $args "faq_pacakge_id"] + } elseif {![empty_string_p $community_id]} { + # the portal_id is a community portal + ad_return_complaint 1 "[applet_key] aks1 unimplimented" + } else { + # the portal_id is a portal template + ad_return_complaint 1 "[applet_key] aks2 unimplimented" + } + + faq_portlet::remove_self_from_page $portal_id $faq_pacakge_id } ad_proc -public clone {