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.38 -r1.39 --- openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 30 Jun 2018 22:04:28 -0000 1.38 +++ openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 30 Jun 2018 22:13:39 -0000 1.39 @@ -15,15 +15,15 @@ # ad_library { - + Procs for the dotLRN Static applet - + @author arjun@openforce.net @cvs-id $Id$ } namespace eval dotlrn_static { - + ad_proc -private my_package_key { } { return "dotlrn-static" @@ -32,26 +32,26 @@ ad_proc -public applet_key {} { What's my key? } { - return "dotlrn_static" + return "dotlrn_static" } ad_proc -public package_key { } { - Get the package_key this applet deals with. + Get the package_key this applet deals with. This is _unlike_ a package like bboard since there's - no "static" package but a combined "static-portlet" - package. I named it "static-portlet" instead of + no "static" package but a combined "static-portlet" + package. I named it "static-portlet" instead of "static" since it's tied to (new-portal) so strongly } { - return "static-portlet" + return "static-portlet" } ad_proc -public get_pretty_name { } { - returns the pretty name + returns the pretty name } { - return "[_ [pretty_name_key]]" + return "[_ [pretty_name_key]]" } ad_proc -private pretty_name_key { @@ -62,8 +62,8 @@ ad_proc -public add_applet { } { - Add the static applet to dotlrn - for one-time init - Must be repeatable! + Add the static applet to dotlrn - for one-time init + Must be repeatable! } { if {![dotlrn_applet::applet_exists_p -applet_key [applet_key]]} { @@ -83,17 +83,17 @@ } ad_proc -public remove_applet { - package_id + package_id } { - remove the applet from dotlrn + remove the applet from dotlrn } { ad_return_complaint 1 "[applet_key] remove_applet not implemented!" } ad_proc -public add_applet_to_community { - community_id + community_id } { - Add the static applet to a dotlrn community + Add the static applet to a dotlrn community } { # set up admin portlet @@ -106,22 +106,22 @@ set args [ns_set create] - set template_id [portal::get_portal_template_id $portal_id] - - if {$template_id eq ""} { - - set template_id $portal_id - } - - ns_set put $args "package_id" $community_id + set template_id [portal::get_portal_template_id $portal_id] + + if {$template_id eq ""} { + + set template_id $portal_id + } + + ns_set put $args "package_id" $community_id ns_set put $args "template_id" $template_id - - # quit if new_content_id is empty, this means the template - # portal does not have custom portlets + + # quit if new_content_id is empty, this means the template + # portal does not have custom portlets if { [set new_content_id [add_portlet_helper $portal_id $args]] eq "" } { - return - } - + return + } + # 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 \ @@ -145,57 +145,57 @@ } ad_proc -public remove_applet_from_community { - community_id + community_id } { - Remove static applet from a dotlrn community + Remove static applet from a dotlrn community } { ad_return_complaint 1 "[applet_key] remove_applet not implemented!" } ad_proc -public add_user { - community_id + community_id } { - Called when the user is initially added as a dotlrn user. + Called when the user is initially added as a dotlrn user. } { - # noop + # noop } ad_proc -public remove_user { user_id } { } { - # noop + # noop } 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 } { - # noop + # noop } ad_proc -public remove_user_from_community { - community_id - user_id + community_id + user_id } { - Remove a user from a community. Since this applet is not shown + Remove a user from a community. Since this applet is not shown on a user's portal, no action is required here. } { - # noop + # noop } ad_proc -public add_portlet { portal_id } { - A helper proc to add the underlying portlet to the given portal. - + A helper proc to add the underlying portlet to the given portal. + @param portal_id } { set type [dotlrn::get_type_from_portal_id -portal_id $portal_id] set package_id 0 - + if {$type eq "user"} { # do nothing for the user portal template return @@ -218,7 +218,7 @@ -package_id $package_id \ -content "$pretty_name" \ -pretty_name "$pretty_name" - ] + ] } else { # for class instances # Used by en_US messages below @@ -244,7 +244,7 @@ } { } { - 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"] \ @@ -254,8 +254,8 @@ ad_proc -public remove_portlet { args } { - A helper proc to remove the underlying portlet from the given portal. - + 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 } { ad_return_complaint 1 "[applet_key] remove_portlet not implemented!" @@ -271,18 +271,18 @@ static_portal_content::clone \ -portal_id [dotlrn_community::get_portal_id_not_cached \ -community_id $new_community_id] \ - -package_id $new_community_id + -package_id $new_community_id } ad_proc -public change_event_handler { community_id event old_value new_value - } { - listens for the following events: - } { - } + } { + listens for the following events: + } { + } } # Local variables: