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 } } - + }