Index: openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl 29 Mar 2002 19:43:33 -0000 1.4 +++ openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl 9 May 2002 23:59:54 -0000 1.5 @@ -14,22 +14,17 @@ # details. # -# /packages/dotlrn-static/tcl/static-portlet-procs.tcl ad_library { -Procedures to supports static portlets + Procedures to supports static portlets -Copyright Openforce, Inc. -Licensed under GNU GPL v2 - -@author arjun@openforce.net -@cvs-id $Id$ - + @author arjun@openforce.net + @cvs-id $Id$ } namespace eval static_portlet { - ad_proc -private my_name { + ad_proc -private get_my_name { } { return "static_portlet" } @@ -55,40 +50,18 @@ } { Adds a static PE to the given page } { - # we don't care if there are other instaces of the - # static portlet in this portal since this PE only has one - # and only one instace_id. i.e. There is no aggregation - # unlike bboard-portlet for instance + # there is no aggregation, so use: + set element_id [portal::add_element \ + -portal_id $portal_id \ + -portlet_name [get_my_name] + ] - # Tell portal to add this element to the page - set element_id [portal::add_element $portal_id [my_name]] - # Set the instace of "static-portlet" that this PE will know portal::set_element_param $element_id instance_id $instance_id return $element_id } - ad_proc -public show { - cf - } { - Display the PE - } { - - portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf \ - -template_src "static-portlet" - } - - ad_proc -public edit { - element_id - } { - Display the PE's edit page - } { - return "" - } - ad_proc -public remove_self_from_page { portal_id element_id @@ -99,27 +72,16 @@ portal::remove_element $element_id } - ad_proc -public make_self_available { - portal_id + ad_proc -public show { + cf } { - Wrapper for the portal:: proc - - @param portal_id } { - portal::make_datasource_available \ - $portal_id [portal::get_datasource_id [my_name]] - } - - ad_proc -public make_self_unavailable { - portal_id - } { - Wrapper for the portal:: proc - - @param portal_id - } { - portal::make_datasource_unavailable \ - $portal_id [portal::get_datasource_id [my_name]] - } + + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "static-portlet" + } }