Index: openacs-4/packages/bboard-portlet/tcl/bboard-portlets-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/tcl/Attic/bboard-portlets-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bboard-portlet/tcl/bboard-portlets-procs.tcl 1 Oct 2001 00:06:17 -0000 1.2 +++ openacs-4/packages/bboard-portlet/tcl/bboard-portlets-procs.tcl 4 Oct 2001 16:01:37 -0000 1.3 @@ -9,35 +9,37 @@ @$Id$ } +namespace eval bboard_portlet { -ad_proc bboard_portlets_mount_application { - { -object_id "" } - { -node_id "" } - { -package_id "" } -} { - Mounts a bboard application beneath the portal associated with - object_id. If no such portal exists, does nothing. This function is - used as a callback in the acs-subsite group callback system - @author arjun@openforce.net - @creation-date Sept 2001 + ad_proc -private name {} { + This datasource's name - @return The package id of the newly mounted package, or the empty - string if no package was mounted + @author arjun@openforce.net + @creation-date Sept 2001 + } { + return "bboard-portlet" + } -} { -# AKS: don't do this, although it is a neat trick that might be useful -# in the future of dotlrn -# -# -# if { [empty_string_p $object_id] } { -# error "Object ID must be specified" -# } -# -# # Find the node ID for the portal associated with this object -# set node_id [portal_node_id_for_object $object_id] -# if { [empty_string_p $node_id] } { -# return "" -# } -# return [subsite::auto_mount_application -node_id $node_id bboard] -} + ad_proc add_self_to_page { page_id instance_id } { + Adds a bboard PE to the given page with the instance key being + opaque data in the portal configuration. + + @param page_id The page to add self to + @param instance_id The bboard instace to show + @author arjun@openforce.net + @creation-date Sept 2001 + } { + # Tell portal to add this element to the page + set element_id [portal::add_element {$page_id [name]}] + + # The default param "instance_id" must be configured + set key "instance_id" + set value [portal::get_element_param $element_id $key] + + ns_log Notice "AKSbboard-portlet: instance_id's value: $value" + + portal::set_element_param $element_id $key $instance_id + + } +} # namespace