Index: openacs-4/packages/calendar-portlet/tcl/calendar-full-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/tcl/calendar-full-portlet-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/calendar-portlet/tcl/calendar-full-portlet-procs.tcl 29 Mar 2002 18:52:51 -0000 1.3 +++ openacs-4/packages/calendar-portlet/tcl/calendar-full-portlet-procs.tcl 9 May 2002 23:59:51 -0000 1.4 @@ -14,19 +14,16 @@ # details. # -# calendar-portlet/tcl/calendar-portlet-procs.tcl - ad_library { -Procedures to support the calendar portlet + Procedures to support the "full" calendar portlet. This is the + "wide" calendar with the navigation widget and helpful links. Not + to be confused with the (regular, narrow) calendar portlet that is titled + "Day Summary" by default. -Copyright Openforce, Inc. -Licensed under GNU GPL v2 - -@creation-date Oct 26 2001 -@author arjun@openforce.net -@cvs-id $Id$ - + @creation-date Oct 26 2001 + @author arjun@openforce.net + @cvs-id $Id$ } namespace eval calendar_full_portlet { @@ -36,122 +33,62 @@ return "calendar-portlet" } - ad_proc -private my_name { + ad_proc -private get_my_name { } { return "calendar_full_portlet" } ad_proc -public get_pretty_name { } { - return [ad_parameter \ - -package_id [apm_package_id_from_key [my_package_key]] \ - "full_portlet_pretty_name"] + return [ad_parameter "full_portlet_pretty_name" [my_package_key]] } ad_proc -public link { } { - return "calendar" + return "" } ad_proc -public add_self_to_page { {-page_id ""} portal_id calendar_id } { - Adds a calendar PE to the given page with the community_id. + Adds a "full" calendar PE to the given portal - @return element_id The new element's id @param portal_id The page to add self to @param calendar_id The new calendar_id to add - @author arjun@openforce.net - @creation-date Sept 2001 + @return element_id The new element's id } { - return [portal::add_element_or_append_id -portal_id $portal_id \ + return [portal::add_element_or_append_id \ + -portal_id $portal_id \ -page_id $page_id \ - -portlet_name [my_name] \ + -portlet_name [get_my_name] \ -pretty_name [get_pretty_name] \ -value_id $calendar_id \ -key calendar_id] } ad_proc -public remove_self_from_page { portal_id - package_id + calendar_id } { - Removes a calendar PE from the given page - - @param portal_id The page to remove self from - @param community_id - @author arjun@openforce.net - @creation-date Sept 2001 + Removes a "full" calendar PE from the given page or + a calendar_id from its params } { - ## YOWSA (ben) - # calendar portlet should NOT be creating and deleting calendars! - # I've taken out a chunk of code here that was removing calendars. No way! (ben). - - # get rid of this portal element - # This automatically removes all element params - portal::remove_element_or_remove_id -portal_id $portal_id -portlet_name [my_name] -key calendar_id -value_id $package_id + portal::remove_element_or_remove_id \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key calendar_id \ + -value_id $package_id } - - - ad_proc -public make_self_available { - page_id - } { - Wrapper for the portal:: proc - - @param page_id - @author arjun@openforce.net - @creation-date Nov 2001 - } { - portal::make_datasource_available \ - $page_id [portal::get_datasource_id [my_name]] - } - - ad_proc -public make_self_unavailable { - page_id - } { - Wrapper for the portal:: proc - - @param page_id - @author arjun@openforce.net - @creation-date Nov 2001 - } { - portal::make_datasource_unavailable \ - $page_id [portal::get_datasource_id [my_name]] - } - - ad_proc -public show { cf } { - Display the PE - - @return HTML string - @param cf A config array - @author arjun@openforce.net - @creation-date Sept 2001 } { - # no return call required with the helper proc portal::show_proc_helper \ -package_key [my_package_key] \ -config_list $cf \ -template_src "calendar-full-portlet" } - ad_proc -public edit { - element_id - } { - Display the PE's edit page - - @return HTML string - @param cf A config array - @author arjun@openforce.net - @creation-date Nov 2001 - } { - # We're going to have to replace this stuff with real templated stuff - } - - - }