Index: openacs-4/packages/bboard-portlet/bboard-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/bboard-portlet.info,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/bboard-portlet/bboard-portlet.info 20 Jan 2002 19:19:23 -0000 1.7 +++ openacs-4/packages/bboard-portlet/bboard-portlet.info 9 May 2002 23:59:51 -0000 1.8 @@ -32,7 +32,7 @@ - + Index: openacs-4/packages/bboard-portlet/sql/oracle/bboard-admin-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/sql/oracle/bboard-admin-portlet-create.sql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/bboard-portlet/sql/oracle/bboard-admin-portlet-create.sql 29 Mar 2002 19:51:43 -0000 1.2 +++ openacs-4/packages/bboard-portlet/sql/oracle/bboard-admin-portlet-create.sql 9 May 2002 23:59:51 -0000 1.3 @@ -125,8 +125,8 @@ foo := acs_sc_impl.new_alias ( 'portal_datasource', 'bboard_admin_portlet', - 'MyName', - 'bboard_admin_portlet::my_name', + 'GetMyName', + 'bboard_admin_portlet::get_my_name', 'TCL' ); @@ -178,22 +178,6 @@ 'TCL' ); - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'bboard_admin_portlet', - 'MakeSelfAvailable', - 'bboard_admin_portlet::make_self_available', - 'TCL' - ); - - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'bboard_admin_portlet', - 'MakeSelfUnavailable', - 'bboard_admin_portlet::make_self_unavailable', - 'TCL' - ); - end; / show errors Index: openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-create.sql,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-create.sql 29 Mar 2002 19:51:43 -0000 1.17 +++ openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-create.sql 9 May 2002 23:59:51 -0000 1.18 @@ -136,8 +136,8 @@ foo := acs_sc_impl.new_alias ( 'portal_datasource', 'bboard_portlet', - 'MyName', - 'bboard_portlet::my_name', + 'GetMyName', + 'bboard_portlet::get_my_name', 'TCL' ); @@ -189,22 +189,6 @@ 'TCL' ); - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'bboard_portlet', - 'MakeSelfAvailable', - 'bboard_portlet::make_self_available', - 'TCL' - ); - - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'bboard_portlet', - 'MakeSelfUnavailable', - 'bboard_portlet::make_self_unavailable', - 'TCL' - ); - end; / show errors Index: openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-drop.sql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-drop.sql 29 Mar 2002 19:51:43 -0000 1.3 +++ openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-drop.sql 9 May 2002 23:59:51 -0000 1.4 @@ -60,7 +60,7 @@ foo := acs_sc_impl.delete_alias ( 'portal_datasource', 'bboard_portlet', - 'MyName' + 'GetMyName' ); foo := acs_sc_impl.delete_alias ( @@ -100,18 +100,6 @@ 'RemoveSelfFromPage' ); - foo := acs_sc_impl.delete_alias ( - 'portal_datasource', - 'bboard_portlet', - 'MakeSelfAvailable' - ); - - foo := acs_sc_impl.delete_alias ( - 'portal_datasource', - 'bboard_portlet', - 'MakeSelfUnavailable' - ); - -- Drop the binding acs_sc_binding.delete ( contract_name => 'portal_datasource', Index: openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl 29 Mar 2002 19:51:43 -0000 1.4 +++ openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl 9 May 2002 23:59:51 -0000 1.5 @@ -14,23 +14,18 @@ # details. # -# /packages/bboard-portlets/tcl/bboard-portlets-procs.tcl ad_library { -Procedures to supports bboard admin portlets - -Copyright Openforce, Inc. -Licensed under GNU GPL v2 - -@creation-date September 30 2001 -@author arjun@openforce.net -@cvs-id $Id$ - + Procedures to supports bboard admin portlets + + @creation-date September 30 2001 + @author arjun@openforce.net + @version $Id$ } namespace eval bboard_admin_portlet { - ad_proc -private my_name { + ad_proc -private get_my_name { } { return "bboard_admin_portlet" } @@ -47,127 +42,57 @@ ad_proc -public link { } { - return "bboards" + return "" } ad_proc -public add_self_to_page { portal_id - instance_id - args + instance_id } { - Adds a bboard PE to the given page with the instance key being - opaque data in the portal configuration. - - @return element_id The new element's id - @param portal_id The page to add self to - @param instance_id The bboard instace to show - @param args an arg string not used - @author arjun@openforce.net - @creation-date Sept 2001 + Adds a bboard admin PE to the admin portal + + @return new element_id } { - # Add some smarts to only add one portlet for now when it's added multiple times (ben) - # Find out if bboard already exists - set element_id_list [portal::get_element_ids_by_ds $portal_id [my_name]] + # we use "portal::add_element" here since there is no + # configuration necessary for this portlet (no params) + set element_id [portal::add_element \ + -pretty_name [get_pretty_name] \ + -portal_id $portal_id \ + -portlet_name [get_my_name] + ] - if {[llength $element_id_list] == 0} { - # Tell portal to add this element to the page - set element_id [portal::add_element $portal_id [my_name]] - # There is already a value for the param which must be overwritten - portal::set_element_param $element_id instance_id $instance_id - set package_id_list [list] - } else { - set element_id [lindex $element_id_list 0] - # There are existing values which should NOT be overwritten - portal::add_element_param_value -element_id $element_id -key instance_id -value $instance_id - } - - return $element_id + # XXX AKS1 needs instance_id params??? + portal::set_element_param $element_id "instance_id" $instance_id + return $element_id } + ad_proc -public remove_self_from_page { + portal_id + } { + Removes the bboard admin PE from the portal + } { + portal::remove_element \ + -portal_id $portal_id \ + -datasource_name [get_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 "bboard-admin-portlet" } ad_proc -public edit { - element_id + cf } { - Display the PE's edit page - - @return HTML string - @param cf A config array - @author arjun@openforce.net - @creation-date Nov 2001 } { return "" } - - ad_proc -public remove_self_from_page { - portal_id - instance_id - } { - Removes a bboard PE from the given page - - @param portal_id The page to remove self from - @param instance_id - @author arjun@openforce.net - @creation-date Sept 2001 - } { - # get the element IDs (could be more than one!) - set element_ids [portal::get_element_ids_by_ds $portal_id [my_name]] - - # remove all elements - db_transaction { - foreach element_id $element_ids { - # Highly simplified (ben) - portal::remove_element_param_value -element_id $element_id -key instance_id -value $instance_id - - # Check if we should really remove the element - if {[llength [portal::get_element_param_list -element_id $element_id -key instance_id]] == 0} { - portal::remove_element $element_id - } - } - } - } - - ad_proc -public make_self_available { - portal_id - } { - Wrapper for the portal:: proc - - @param portal_id - @author arjun@openforce.net - @creation-date Nov 2001 - } { - 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 - @author arjun@openforce.net - @creation-date Nov 2001 - } { - portal::make_datasource_unavailable \ - $portal_id [portal::get_datasource_id [my_name]] - } } Index: openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl,v diff -u -N -r1.40 -r1.41 --- openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.40 +++ openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl 9 May 2002 23:59:51 -0000 1.41 @@ -14,23 +14,19 @@ # details. # -# /packages/bboard-portlets/tcl/bboard-portlets-procs.tcl ad_library { -Procedures to supports bboard portlets + Procedures to supports bboard portlets -Copyright Openforce, Inc. -Licensed under GNU GPL v2 + @creation-date September 30 2001 + @author arjun@openforce.net + @version $Id$ -@creation-date September 30 2001 -@author arjun@openforce.net -@cvs-id $Id$ - } namespace eval bboard_portlet { - ad_proc -private my_name { + ad_proc -private get_my_name { } { return "bboard_portlet" } @@ -47,52 +43,42 @@ ad_proc -public link { } { - return "bboards" + return "" } ad_proc -public add_self_to_page { portal_id - instance_id - args + bboard_instance_id } { - Adds a bboard PE to the given page with the instance key being - opaque data in the portal configuration. - - @return element_id The new element's id - @param portal_id The page to add self to - @param instance_id The bboard instace to show - @param args an arg string not used - @author arjun@openforce.net - @creation-date Sept 2001 + Adds a bboard PE to the given portal or appends the given bboard instance_id + to the bboard PE that already on the portal } { - # Add some smarts to only add one portlet for now when it's added multiple times (ben) - # Find out if bboard already exists - set element_id_list [portal::get_element_ids_by_ds $portal_id [my_name]] - if {[llength $element_id_list] == 0} { - # Tell portal to add this element to the page - set element_id [portal::add_element -pretty_name "Bboards" -force_region 1 $portal_id [my_name]] - # There is already a value for the param which must be overwritten - portal::set_element_param $element_id instance_id $instance_id - set package_id_list [list] - } else { - set element_id [lindex $element_id_list 0] - # There are existing values which should NOT be overwritten - portal::add_element_param_value -element_id $element_id -key instance_id -value $instance_id - } - - return $element_id + return [portal::add_element_or_append_id \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -pretty_name [get_pretty_name] \ + -value_id $bboard_instance_id \ + -force_region [ad_parameter "bboard_portlet_region" [my_package_key]] + ] } + + ad_proc -public remove_self_from_page { + portal_id + bboard_instance_id + } { + Removes a bboard PE from the given page or just the given bboard's instance_id + } { + portal::remove_element_or_remove_id \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -value_id $bboard_instance_id + } + 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 \ @@ -101,73 +87,6 @@ -template_src "bboard-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 - } { - return "" - } - - - ad_proc -public remove_self_from_page { - portal_id - instance_id - } { - Removes a bboard PE from the given page - - @param portal_id The page to remove self from - @param instance_id - @author arjun@openforce.net - @creation-date Sept 2001 - } { - # get the element IDs (could be more than one!) - set element_ids [portal::get_element_ids_by_ds $portal_id [my_name]] - - # remove all elements - db_transaction { - foreach element_id $element_ids { - # Highly simplified (ben) - portal::remove_element_param_value -element_id $element_id -key instance_id -value $instance_id - - # Check if we should really remove the element - if {[llength [portal::get_element_param_list -element_id $element_id -key instance_id]] == 0} { - portal::remove_element $element_id - } - } - } - } - - ad_proc -public make_self_available { - portal_id - } { - Wrapper for the portal:: proc - - @param portal_id - @author arjun@openforce.net - @creation-date Nov 2001 - } { - 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 - @author arjun@openforce.net - @creation-date Nov 2001 - } { - portal::make_datasource_unavailable \ - $portal_id [portal::get_datasource_id [my_name]] - } } Index: openacs-4/packages/calendar-portlet/calendar-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/calendar-portlet.info,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/calendar-portlet/calendar-portlet.info 17 Apr 2002 16:06:59 -0000 1.7 +++ openacs-4/packages/calendar-portlet/calendar-portlet.info 9 May 2002 23:59:51 -0000 1.8 @@ -40,6 +40,7 @@ + Index: openacs-4/packages/calendar-portlet/sql/oracle/calendar-admin-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/sql/oracle/calendar-admin-portlet-create.sql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/calendar-portlet/sql/oracle/calendar-admin-portlet-create.sql 29 Mar 2002 18:52:51 -0000 1.2 +++ openacs-4/packages/calendar-portlet/sql/oracle/calendar-admin-portlet-create.sql 9 May 2002 23:59:51 -0000 1.3 @@ -148,8 +148,8 @@ foo := acs_sc_impl.new_alias ( 'portal_datasource', 'calendar_admin_portlet', - 'MyName', - 'calendar_admin_portlet::my_name', + 'GetMyName', + 'calendar_admin_portlet::get_my_name', 'TCL' ); @@ -201,22 +201,6 @@ 'TCL' ); - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'calendar_admin_portlet', - 'MakeSelfAvailable', - 'calendar_admin_portlet::make_self_available', - 'TCL' - ); - - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'calendar_admin_portlet', - 'MakeSelfUnavailable', - 'calendar_admin_portlet::make_self_unavailable', - 'TCL' - ); - end; / show errors Index: openacs-4/packages/calendar-portlet/sql/oracle/calendar-full-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/sql/oracle/calendar-full-portlet-create.sql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/calendar-portlet/sql/oracle/calendar-full-portlet-create.sql 29 Mar 2002 18:52:51 -0000 1.2 +++ openacs-4/packages/calendar-portlet/sql/oracle/calendar-full-portlet-create.sql 9 May 2002 23:59:51 -0000 1.3 @@ -148,8 +148,8 @@ foo := acs_sc_impl.new_alias ( 'portal_datasource', 'calendar_full_portlet', - 'MyName', - 'calendar_full_portlet::my_name', + 'GetMyName', + 'calendar_full_portlet::get_my_name', 'TCL' ); @@ -201,22 +201,6 @@ 'TCL' ); - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'calendar_full_portlet', - 'MakeSelfAvailable', - 'calendar_full_portlet::make_self_available', - 'TCL' - ); - - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'calendar_full_portlet', - 'MakeSelfUnavailable', - 'calendar_full_portlet::make_self_unavailable', - 'TCL' - ); - end; / show errors Index: openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-create.sql,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-create.sql 29 Mar 2002 18:52:51 -0000 1.17 +++ openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-create.sql 9 May 2002 23:59:51 -0000 1.18 @@ -147,8 +147,8 @@ foo := acs_sc_impl.new_alias ( 'portal_datasource', 'calendar_portlet', - 'MyName', - 'calendar_portlet::my_name', + 'GetMyName', + 'calendar_portlet::get_my_name', 'TCL' ); @@ -200,22 +200,6 @@ 'TCL' ); - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'calendar_portlet', - 'MakeSelfAvailable', - 'calendar_portlet::make_self_available', - 'TCL' - ); - - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'calendar_portlet', - 'MakeSelfUnavailable', - 'calendar_portlet::make_self_unavailable', - 'TCL' - ); - end; / show errors Index: openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-drop.sql,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-drop.sql 29 Mar 2002 18:52:51 -0000 1.4 +++ openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-drop.sql 9 May 2002 23:59:51 -0000 1.5 @@ -58,7 +58,7 @@ foo := acs_sc_impl.delete_alias ( 'portal_datasource', 'calendar_portlet', - 'MyName' + 'GetMyName' ); foo := acs_sc_impl.delete_alias ( @@ -98,18 +98,6 @@ 'RemoveSelfFromPage' ); - foo := acs_sc_impl.delete_alias ( - 'portal_datasource', - 'calendar_portlet', - 'MakeSelfAvailable' - ); - - foo := acs_sc_impl.delete_alias ( - 'portal_datasource', - 'calendar_portlet', - 'MakeSelfUnavailable' - ); - -- Drop the binding acs_sc_binding.delete ( contract_name => 'portal_datasource', Index: openacs-4/packages/calendar-portlet/tcl/calendar-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/tcl/calendar-admin-portlet-procs.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/calendar-portlet/tcl/calendar-admin-portlet-procs.tcl 25 Apr 2002 04:25:29 -0000 1.5 +++ openacs-4/packages/calendar-portlet/tcl/calendar-admin-portlet-procs.tcl 9 May 2002 23:59:51 -0000 1.6 @@ -14,20 +14,14 @@ # details. # -# calendar-portlet/tcl/calendar-portlet-procs.tcl - ad_library { + + Procedures to support the calendar admin portlet -Procedures to support the calendar admin portlet - -Copyright Openforce, Inc. -Licensed under GNU GPL v2 - -@creation-date Jan 2002 -@author arjun@openforce.net -@author ben@openforce.net -@cvs-id $Id$ - + @creation-date Jan 2002 + @author arjun@openforce.net + @author ben@openforce.net + @cvs-id $Id$ } namespace eval calendar_admin_portlet { @@ -37,194 +31,59 @@ return "calendar-portlet" } - ad_proc -private my_name { + ad_proc -private get_my_name { } { return "calendar_admin_portlet" } ad_proc -public get_pretty_name { } { - # name hard wired for administration purposes (ben) return "Calendar Administration" } ad_proc -public link { } { - return "calendar" + return "" } ad_proc -public add_self_to_page { portal_id calendar_id } { - Adds a calendar PE to the given page with the community_id. + Adds a admin 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 \ - -portlet_name [my_name] \ - -value_id $calendar_id \ - -key calendar_id] - } + set element_id [portal::add_element \ + -portal_id $portal_id \ + -portlet_name [get_my_name] + ] + portal::set_element_param $element_id "calendar_id" $calendar_id + + return $element_id + } + ad_proc -public remove_self_from_page { portal_id - community_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 calendar admin PE } { - # it's more simple not to use portal::remove_element_or_remove_id here - - # get the element IDs (could be more than one!) - set element_ids [portal::get_element_ids_by_ds $portal_id \ - [my_name]] - - # remove all elements - db_transaction { - foreach element_id $element_ids { - - set calendar_id \ - [portal::get_element_param $element_id "calendar_id"] - - set g_cal_id \ - [portal::get_element_param $element_id "calendar_id"] - - # don't delete the public calendar! - if {[calendar_public_p $calendar_id] == "f"} { - - ns_log notice "aks15 in calendar_portlet remove_self_from_page $calendar_id/$element_id/$g_cal_id" - - # delete the personal calendar associated with this element - db_exec_plsql delete_calendar { - begin - calendar.delete( - calendar_id => :calendar_id - ); - end; - } - } - # get rid of this portal element - portal::remove_element $element_id - } - } - + portal::remove_element \ + -portal_id $portal_id \ + -portlet_name [get_my_name] } - - 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-admin-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 - } { - - set calendar_id [portal::get_element_param $element_id "calendar_id"] - set current_view [portal::get_element_param $element_id "default_view"] - - switch $current_view { - "day" { - set html "Set default view to:

- - - day - week - month - list - " - } - "week" { - set html "Set default view to:

- - - day - week - month - list - " - } - "month" { - set html "Set default view to:

- - - day - week - month - list - " - - } - "list" { - set html "Set default view to:

- - - day - week - month - list - " - } - - return $html - } - } - - - } 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 -N -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 - } - - - } Index: openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl,v diff -u -N -r1.25 -r1.26 --- openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl 16 Apr 2002 05:16:28 -0000 1.25 +++ openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl 9 May 2002 23:59:51 -0000 1.26 @@ -14,19 +14,14 @@ # details. # -# calendar-portlet/tcl/calendar-portlet-procs.tcl - ad_library { + + Procedures to support the (normal, narrow) calendar portlet a.k.a. + "Day Summary". Not to be confused with the "full" calendar portlet. -Procedures to support the calendar portlet + @author arjun@openforce.net + @cvs-id $Id$ -Copyright Openforce, Inc. -Licensed under GNU GPL v2 - -@creation-date Oct 26 2001 -@author arjun@openforce.net -@cvs-id $Id$ - } namespace eval calendar_portlet { @@ -36,170 +31,68 @@ return "calendar-portlet" } - ad_proc -private my_name { + ad_proc -private get_my_name { } { return "calendar_portlet" } ad_proc -public get_pretty_name { } { - return [ad_parameter \ - -package_id [apm_package_id_from_key [my_package_key]] \ - "pretty_name"] + return [ad_parameter "pretty_name" [my_package_key]] } ad_proc -public link { } { - return [get_pretty_name] + 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 (normal) calendar PE to the given page or appends a + calendar_id to the current calendar portlet - @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 \ - -force_region 2 \ - -key calendar_id] + -force_region [ad_parameter "force_region" [my_package_key]] \ + -key calendar_id + ] } ad_proc -public remove_self_from_page { portal_id calendar_id } { - Removes a calendar PE from the given page + Removes a calendar PE from the given page or just + the given calendar_id @param portal_id The page to remove self from - @param community_id - @author arjun@openforce.net - @creation-date Sept 2001 + @param calendar_id } { - ## 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 $calendar_id + portal::remove_element_or_remove_id \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key calendar_id \ + -value_id $calendar_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 } - 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 - } { - - set calendar_id [portal::get_element_param $element_id "calendar_id"] - set current_view [portal::get_element_param $element_id "default_view"] - - switch $current_view { - "day" { - set html "Set default view to:

- - - day - week - month - list - " - } - "week" { - set html "Set default view to:

- - - day - week - month - list - " - } - "month" { - set html "Set default view to:

- - - day - week - month - list - " - - } - "list" { - set html "Set default view to:

- - - day - week - month - list - " - } - - return $html - } - } - - - } Index: openacs-4/packages/dotlrn/dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v diff -u -N -r1.77 -r1.78 --- openacs-4/packages/dotlrn/dotlrn.info 8 May 2002 14:35:07 -0000 1.77 +++ openacs-4/packages/dotlrn/dotlrn.info 9 May 2002 23:59:51 -0000 1.78 @@ -407,6 +407,7 @@ + Index: openacs-4/packages/dotlrn/sql/oracle/main-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/main-portlet-create.sql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/dotlrn/sql/oracle/main-portlet-create.sql 6 May 2002 23:55:01 -0000 1.1 +++ openacs-4/packages/dotlrn/sql/oracle/main-portlet-create.sql 9 May 2002 23:59:51 -0000 1.2 @@ -99,20 +99,12 @@ 'dotlrn_main_portlet' ); -end; -/ -show errors - -declare - foo integer; -begin - -- add all the hooks foo := acs_sc_impl.new_alias ( 'portal_datasource', 'dotlrn_main_portlet', - 'MyName', - 'dotlrn_main_portlet::my_name', + 'GetMyName', + 'dotlrn_main_portlet::get_my_name', 'TCL' ); @@ -140,39 +132,31 @@ 'TCL' ); + foo := acs_sc_impl.new_alias ( 'portal_datasource', 'dotlrn_main_portlet', - 'Show', - 'dotlrn_main_portlet::show', + 'RemoveSelfFromPage', + 'dotlrn_main_portlet::remove_self_from_page', 'TCL' ); foo := acs_sc_impl.new_alias ( 'portal_datasource', 'dotlrn_main_portlet', - 'Edit', - 'dotlrn_main_portlet::edit', + 'Show', + 'dotlrn_main_portlet::show', 'TCL' ); foo := acs_sc_impl.new_alias ( 'portal_datasource', 'dotlrn_main_portlet', - 'RemoveSelfFromPage', - 'dotlrn_main_portlet::remove_self_from_page', + 'Edit', + 'dotlrn_main_portlet::edit', 'TCL' ); - -end; -/ -show errors - -declare - foo integer; -begin - -- Add the binding acs_sc_binding.new ( contract_name => 'portal_datasource', Index: openacs-4/packages/dotlrn/sql/postgresql/dotlrn-main-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/Attic/dotlrn-main-portlet-create.sql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/postgresql/dotlrn-main-portlet-create.sql 29 Mar 2002 19:14:44 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/postgresql/dotlrn-main-portlet-create.sql 9 May 2002 23:59:51 -0000 1.3 @@ -79,8 +79,8 @@ select acs_sc_impl_alias__new ( ''portal_datasource'', ''dotlrn_main_portlet'', - ''MyName'', - ''dotlrn_main_portlet::my_name'', + ''GetMyName'', + ''dotlrn_main_portlet::get_my_name'', ''TCL'' ); Index: openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl,v diff -u -N -r1.20 -r1.21 --- openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 29 Mar 2002 19:14:45 -0000 1.20 +++ openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 9 May 2002 23:59:52 -0000 1.21 @@ -14,24 +14,21 @@ # details. # -# dotlrn/tcl/dotlrn-main-portlet-procs.tcl - ad_library { - Procedures to supports dotlrn main portlet + The "dotlrn main" portlet shows a list of the classes and communities that + the user is a member of on the user's workspace portal. Not to be confused + with the "dotlrn" portlet that shows the subgroups of the current community + and is only on community portals. - Copyright Openforce, Inc. - Licensed under GNU GPL v2 - - @creation-date November 4 2001 - @author ben@openforce.net + @author ben@openforce.net, arjun@openforce.net @version $Id$ } namespace eval dotlrn_main_portlet { - ad_proc -private my_name { + ad_proc -private get_my_name { } { return "dotlrn_main_portlet" } @@ -47,68 +44,37 @@ } ad_proc -public add_self_to_page { - {-page_id ""} portal_id - instance_id } { - Adds a dotLRN PE to the given page with the instance key being - opaque data in the portal configuration. - - @return element_id The new element's id - @param portal_id The page to add self to - @param instance_id The bboard instace to show - @author arjun@openforce.net - @creation-date Nov 2001 + @return new element_id } { + # we use "portal::add_element" here since there is no + # configuration necessary for this portlet (no params) + return [portal::add_element \ + -force_region [ad_parameter "dotlrn_main_portlet_region" dotlrn] \ + -pretty_name [get_pretty_name] \ + -portal_id $portal_id \ + -portlet_name [get_my_name] + ] + } - # Tell portal to add this element to the page - set element_id [portal::add_element -force_region 2 -page_id $page_id -pretty_name [get_pretty_name] $portal_id [my_name]] - - return $element_id + ad_proc -public remove_self_from_page { + portal_id + } { + Removes the dotlrn main PE from the portal + } { + portal::remove_element \ + -portal_id $portal_id \ + -datasource_name [get_my_name] } ad_proc -public show { cf } { - Display the PE - - @return HTML string - @param cf A config array - @author ben@openforce.net - @creation-date Nov 2001 } { - # no return call required with the helper proc portal::show_proc_helper \ -template_src "dotlrn-main-portlet" \ -package_key "dotlrn" \ -config_list $cf } - - ad_proc -public edit { - cf - } { - return "" - } - - ad_proc -public remove_self_from_page { - portal_id - instance_id - } { - Removes a bboard PE from the given page - - @param portal_id The page to remove self from - @param instance_id - @author ben@openforce.net - @creation-date Nov 2001 - } { - # get the element IDs (could be more than one!) - set element_ids [portal::get_element_ids_by_ds $portal_id [my_name]] - - # remove all elements - db_transaction { - foreach element_id $element_ids { - portal::remove_element $element_id - } - } - } } Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl,v diff -u -N -r1.36 -r1.37 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 6 May 2002 23:55:02 -0000 1.36 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 9 May 2002 23:59:52 -0000 1.37 @@ -103,19 +103,19 @@ ns_set put $extra_vars access_level $access_level ns_set put $extra_vars id $id + set template_id \ + [dotlrn_community::get_type_portal_id -community_type "user_workspace"] db_transaction { set portal_id [portal::create \ - -template_id [dotlrn_community::get_type_portal_id -community_type "user_workspace"] \ + -template_id $template_id \ -name "Your dotLRN Workspace" \ $user_id ] ns_set put $extra_vars portal_id $portal_id - set page_id [portal::get_page_id -portal_id $portal_id -sort_key 0] - dotlrn_main_portlet::add_self_to_page -page_id $page_id $portal_id "" - - # Add the relation (no need to feed in anything for object_id_one, or two for that matter). + # Add the relation (no need to feed in anything for object_id_one, + # or two for that matter). set rel_id [relation_add \ -extra_vars $extra_vars \ -member_state approved \ @@ -124,6 +124,9 @@ $user_id \ ] + # add the "dotlrn main" portlet to the user's workspace + dotlrn_main_portlet::add_self_to_page $portal_id + dotlrn_community::applets_dispatch -op AddUser -list_args [list $user_id] # if the user is a member of communities (from some previous Index: openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl,v diff -u -N -r1.33 -r1.34 --- openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 7 May 2002 22:06:11 -0000 1.33 +++ openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 9 May 2002 23:59:52 -0000 1.34 @@ -14,23 +14,13 @@ # details. # - - -# -# Procs for DOTLRN Bboard Applet -# Copyright 2001 OpenForce, inc. -# Distributed under the GNU GPL v2 -# -# October 5th, 2001 -# - ad_library { Procs to set up the dotLRN Bboard applet @author ben@openforce.net,arjun@openforce.net @creation-date 2001-10-05 - + @version $Id$ } namespace eval dotlrn_bboard { @@ -86,8 +76,6 @@ -community_id $community_id ] - bboard_portlet::make_self_available $portal_id - if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { bboard_portlet::add_self_to_page $portal_id 0 return @@ -125,7 +113,6 @@ set admin_portal_id [dotlrn_community::get_admin_portal_id \ -community_id $community_id ] - bboard_admin_portlet::make_self_available $admin_portal_id bboard_admin_portlet::add_self_to_page $admin_portal_id $package_id # Set up permissions for basic members (Admins inherit no problem) Index: openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl,v diff -u -N -r1.46 -r1.47 --- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 7 May 2002 22:06:11 -0000 1.46 +++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 9 May 2002 23:59:52 -0000 1.47 @@ -59,10 +59,9 @@ ad_proc -public get_user_default_page {} { return the user default page to add the portlet to } { - return [ad_parameter \ - -package_id [apm_package_id_from_key dotlrn-calendar] \ - user_default_page - ] + # there shouldn't need to be a default here, but this + # call is not working for some reason + return [ad_parameter "user_default_page" dotlrn-calendar "Calendar"] } ad_proc -public add_applet { @@ -99,13 +98,15 @@ } { # add this element to the community portal # do this directly, don't use calendar_portlet::add_self_to_page here + + # aks: why direct?? set portal_id [dotlrn_community::get_portal_id -community_id $community_id] - calendar_portlet::make_self_available $portal_id + set element_id [portal::add_element \ -pretty_name [get_pretty_name] \ -force_region 2 \ - $portal_id \ - [calendar_portlet::my_name] + -portal_id $portal_id \ + -portlet_name [calendar_portlet::get_my_name] ] # add the "full calendar" portlet to the commnuity's "calendar" page, @@ -145,12 +146,11 @@ # Add the admin portlet, too set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] - calendar_admin_portlet::make_self_available $admin_portal_id + set element_id [portal::add_element \ + -portal_id $admin_portal_id \ + -portlet_name [calendar_admin_portlet::get_my_name] + ] - set element_id \ - [portal::add_element $admin_portal_id \ - [calendar_admin_portlet::my_name]] - # set the group_calendar_id parameter in the admin portal. portal::set_element_param \ $element_id "calendar_id" $group_calendar_id @@ -240,34 +240,27 @@ set admin_portal_id \ [dotlrn_community::get_admin_portal_id -community_id $community_id] - calendar_admin_portlet::make_self_unavailable $admin_portal_id - set admin_element_id [portal::get_element_ids_by_ds \ $admin_portal_id \ - [calendar_admin_portlet::my_name] + [calendar_admin_portlet::get_my_name] ] portal::remove_element $admin_element_id - # now for the "regular" calendar portlet from the comm's portal set portal_id [dotlrn_community::get_portal_id \ -community_id $community_id ] - calendar_portlet::make_self_unavailable $portal_id - portal::remove_element [portal::get_element_ids_by_ds \ $portal_id \ - [calendar_portlet::my_name] + [calendar_portlet::get_my_name] ] # now for the "full calendar" portlet from the comm's portal - calendar_full_portlet::make_self_unavailable $portal_id - portal::remove_element [portal::get_element_ids_by_ds \ $portal_id \ - [calendar_full_portlet::my_name] + [calendar_full_portlet::get_my_name] ] # and finally kill the group calendar @@ -311,9 +304,7 @@ } set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] - calendar_portlet::make_self_available $workspace_portal_id - calendar_full_portlet::make_self_available $workspace_portal_id - + # add the "day summary" pe to the user's first workspace page set element_id [calendar_portlet::add_self_to_page \ $workspace_portal_id \ @@ -343,10 +334,8 @@ set calendar_id [calendar_have_private_p -return_id 1 $user_id] calendar_portlet::remove_self_from_page $workspace_portal_id $calendar_id - calendar_portlet::make_self_unavailable $workspace_portal_id calendar_full_portlet::remove_self_from_page $workspace_portal_id $calendar_id - calendar_full_portlet::make_self_unavailable $workspace_portal_id } ad_proc -public add_user_to_community { @@ -391,7 +380,7 @@ # get the calendar element for this community set element_id [portal::get_element_ids_by_ds \ $portal_id \ - [calendar_portlet::my_name] + [calendar_portlet::get_my_name] ] return [portal::get_element_param $element_id "calendar_id"] Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl,v diff -u -N -r1.21 -r1.22 --- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 6 May 2002 23:56:26 -0000 1.21 +++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 9 May 2002 23:59:52 -0000 1.22 @@ -69,7 +69,6 @@ Add the dotlrn applet to a specific community } { set pt_id [dotlrn_community::get_portal_id -community_id $community_id] - dotlrn_portlet::make_self_available $pt_id dotlrn_portlet::add_self_to_page $pt_id $community_id if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { @@ -78,7 +77,6 @@ # set up the DS for the admin page set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] - dotlrn_admin_portlet::make_self_available $admin_portal_id dotlrn_admin_portlet::add_self_to_page $admin_portal_id $community_id return $community_id Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl 6 May 2002 23:56:26 -0000 1.5 +++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl 9 May 2002 23:59:52 -0000 1.6 @@ -80,9 +80,6 @@ } { # portal template stuff set portal_id [dotlrn_community::get_portal_id -community_id $community_id] - - dotlrn_members_portlet::make_self_available $portal_id - set community_type [dotlrn_community::get_community_type_from_community_id $community_id] if {$community_type == "dotlrn_community"} { Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl 6 May 2002 23:56:26 -0000 1.3 +++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl 9 May 2002 23:59:52 -0000 1.4 @@ -59,7 +59,6 @@ } { set portal_id [dotlrn_community::get_portal_id -community_id $community_id] - dotlrn_members_staff_portlet::make_self_available $portal_id dotlrn_members_staff_portlet::add_self_to_page $portal_id $community_id } 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 -N -r1.27 -r1.28 --- openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 7 May 2002 17:53:51 -0000 1.27 +++ openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 9 May 2002 23:59:52 -0000 1.28 @@ -73,8 +73,6 @@ set portal_id [dotlrn_community::get_portal_id -community_id $community_id] # set up the DS for the portal template - faq_portlet::make_self_available $portal_id - if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { faq_portlet::add_self_to_page $portal_id 0 return @@ -87,13 +85,39 @@ # set up the DS for the admin page set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] - faq_admin_portlet::make_self_available $admin_portal_id faq_admin_portlet::add_self_to_page $admin_portal_id $package_id # return the package_id return $package_id } + ad_proc -public remove_applet_from_community { + comminuty_id + } { + Drops the faq applet from the given community + } { + # remove the faq admin portlet from the comm's admin page + set admin_portal_id \ + [dotlrn_community::get_admin_portal_id -community_id $community_id] + set admin_element_id [portal::get_element_ids_by_ds \ + $admin_portal_id \ + [faq_admin_portlet::get_my_name] + ] + + portal::remove_element $admin_element_id + + # remove the faq portlet from the comm's portal + set portal_id \ + [dotlrn_community::get_portal_id -community_id $community_id] + + portal::remove_element [portal::get_element_ids_by_ds \ + $portal_id \ + [faq_portlet::get_my_name] + ] + + + } + ad_proc -public add_user { user_id } { Index: openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl,v diff -u -N -r1.54 -r1.55 --- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 6 May 2002 23:56:28 -0000 1.54 +++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 9 May 2002 23:59:52 -0000 1.55 @@ -139,8 +139,6 @@ # set up the DS for the portal template # that's the private folder_id there - fs_portlet::make_self_available $portal_id - # add the portlet to the "file storage" page for this comm # aks - this should be made into a dotlrn-fs param Index: openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 6 May 2002 23:56:29 -0000 1.17 +++ openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 9 May 2002 23:59:52 -0000 1.18 @@ -74,8 +74,6 @@ } { set portal_id [dotlrn_community::get_portal_id -community_id $community_id] - news_portlet::make_self_available $portal_id - if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { news_portlet::add_self_to_page $portal_id 0 return @@ -93,7 +91,6 @@ # set up the DS for the admin portal set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] - news_admin_portlet::make_self_available $admin_portal_id news_admin_portlet::add_self_to_page $admin_portal_id $package_id return $package_id Index: openacs-4/packages/dotlrn-portlet/dotlrn-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/dotlrn-portlet.info,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/dotlrn-portlet/dotlrn-portlet.info 3 Apr 2002 22:45:49 -0000 1.10 +++ openacs-4/packages/dotlrn-portlet/dotlrn-portlet.info 9 May 2002 23:59:52 -0000 1.11 @@ -43,7 +43,9 @@ - + + + Index: openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-admin-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-admin-portlet-create.sql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-admin-portlet-create.sql 29 Mar 2002 19:20:49 -0000 1.2 +++ openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-admin-portlet-create.sql 9 May 2002 23:59:52 -0000 1.3 @@ -125,8 +125,8 @@ foo := acs_sc_impl.new_alias ( 'portal_datasource', 'dotlrn_admin_portlet', - 'MyName', - 'dotlrn_admin_portlet::my_name', + 'GetMyName', + 'dotlrn_admin_portlet::get_my_name', 'TCL' ); @@ -178,22 +178,6 @@ 'TCL' ); - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'dotlrn_admin_portlet', - 'MakeSelfAvailable', - 'dotlrn_admin_portlet::make_self_available', - 'TCL' - ); - - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'dotlrn_admin_portlet', - 'MakeSelfUnavailable', - 'dotlrn_admin_portlet::make_self_unavailable', - 'TCL' - ); - end; / show errors Index: openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-portlet-create.sql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-portlet-create.sql 29 Mar 2002 19:20:49 -0000 1.2 +++ openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-portlet-create.sql 9 May 2002 23:59:52 -0000 1.3 @@ -121,8 +121,8 @@ foo := acs_sc_impl.new_alias ( 'portal_datasource', 'dotlrn_members_portlet', - 'MyName', - 'dotlrn_members_portlet::my_name', + 'GetMyName', + 'dotlrn_members_portlet::get_my_name', 'TCL' ); @@ -174,22 +174,6 @@ 'TCL' ); - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'dotlrn_members_portlet', - 'MakeSelfAvailable', - 'dotlrn_members_portlet::make_self_available', - 'TCL' - ); - - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'dotlrn_members_portlet', - 'MakeSelfUnavailable', - 'dotlrn_members_portlet::make_self_unavailable', - 'TCL' - ); - end; / show errors Index: openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-staff-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-staff-portlet-create.sql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-staff-portlet-create.sql 29 Mar 2002 19:20:49 -0000 1.2 +++ openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-staff-portlet-create.sql 9 May 2002 23:59:52 -0000 1.3 @@ -122,8 +122,8 @@ foo := acs_sc_impl.new_alias ( 'portal_datasource', 'dotlrn_members_staff_portlet', - 'MyName', - 'dotlrn_members_staff_portlet::my_name', + 'GetMyName', + 'dotlrn_members_staff_portlet::get_my_name', 'TCL' ); @@ -175,22 +175,6 @@ 'TCL' ); - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'dotlrn_members_staff_portlet', - 'MakeSelfAvailable', - 'dotlrn_members_staff_portlet::make_self_available', - 'TCL' - ); - - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'dotlrn_members_staff_portlet', - 'MakeSelfUnavailable', - 'dotlrn_members_staff_portlet::make_self_unavailable', - 'TCL' - ); - end; / show errors Index: openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-create.sql,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-create.sql 29 Mar 2002 19:20:49 -0000 1.11 +++ openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-create.sql 9 May 2002 23:59:52 -0000 1.12 @@ -124,8 +124,8 @@ foo := acs_sc_impl.new_alias ( 'portal_datasource', 'dotlrn_portlet', - 'MyName', - 'dotlrn_portlet::my_name', + 'GetMyName', + 'dotlrn_portlet::get_my_name', 'TCL' ); @@ -177,22 +177,6 @@ 'TCL' ); - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'dotlrn_portlet', - 'MakeSelfAvailable', - 'dotlrn_portlet::make_self_available', - 'TCL' - ); - - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'dotlrn_portlet', - 'MakeSelfUnavailable', - 'dotlrn_portlet::make_self_unavailable', - 'TCL' - ); - end; / show errors Index: openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-drop.sql,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-drop.sql 29 Mar 2002 19:20:49 -0000 1.4 +++ openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-drop.sql 9 May 2002 23:59:52 -0000 1.5 @@ -58,7 +58,7 @@ foo := acs_sc_impl.delete_alias ( 'portal_datasource', 'dotlrn_portlet', - 'MyName' + 'GetMyName' ); foo := acs_sc_impl.delete_alias ( @@ -98,18 +98,6 @@ 'RemoveSelfFromPage' ); - foo := acs_sc_impl.delete_alias ( - 'portal_datasource', - 'dotlrn_portlet', - 'MakeSelfAvailable' - ); - - foo := acs_sc_impl.delete_alias ( - 'portal_datasource', - 'dotlrn_portlet', - 'MakeSelfUnavailable' - ); - -- Drop the binding acs_sc_binding.delete ( contract_name => 'portal_datasource', Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.5 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl 9 May 2002 23:59:52 -0000 1.6 @@ -14,24 +14,20 @@ # details. # -# /packages/dotlrn-portlets/tcl/dotlrn-portlets-procs.tcl ad_library { -Procedures to supports dotlrn admin portlets + Procedures to supports dotlrn admin portlets -Copyright Openforce, Inc. -Licensed under GNU GPL v2 + @creation-date September 30 2001 + @author arjun@openforce.net + @author ben@openforce.net + @version $Id$ -@creation-date September 30 2001 -@author arjun@openforce.net -@author ben@openforce.net -@cvs-id $Id$ - } namespace eval dotlrn_admin_portlet { - ad_proc -private my_name { + ad_proc -private get_my_name { } { return "dotlrn_admin_portlet" } @@ -51,102 +47,49 @@ return "" } - ad_proc -public add_self_to_page { - portal_id + admin_portal_id community_id } { - Adds a dotlrn PE to the given page with the community_id as - opaque data in the portal configuration. + Adds the dotlrn admin PE to the given page with the community_id as + as parameter - @return element_id The new element's id @param portal_id The page to add self to @param community_id The dotlrn community to show info about - @author arjun@openforce.net - @creation-date Sept 2001 + @return element_id The new element's id } { - # Tell portal to add this element to the page - set element_id [portal::add_element -force_region 1 $portal_id [my_name]] - - # The default param must be configured - set key "community_id" - # set value [portal::get_element_param $element_id $key] + set element_id [portal::add_element \ + -portal_id $admin_portal_id \ + -portlet_name [get_my_name] \ + -force_region [ad_parameter "dotlrn_admin_portlet_force_region" [my_package_key]] + ] - portal::set_element_param $element_id $key $community_id + # set the community_id param that this portlet needs + portal::set_element_param $element_id "community_id" $community_id return $element_id } + ad_proc -public remove_self_from_page { + portal_id + } { + Removes a dotlrn PE from the given portal + } { + portal::remove_element \ + -portal_id $portal_id \ + -portlet_name [get_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 "dotlrn-admin-portlet" } - ad_proc -public remove_self_from_page { - portal_id - community_id - } { - Removes a dotlrn 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 - } { - # get the element IDs (could be more than one!) - set element_ids [portal::get_element_ids_by_ds $portal_id [my_name]] - - # remove all elements - db_transaction { - foreach element_id $element_ids { - portal::remove_element $element_id - } - } - } - - ad_proc -public edit { - nothing here, move along - } { - return "" - } - - ad_proc -public make_self_available { - portal_id - } { - Wrapper for the portal:: proc - - @param portal_id - @author arjun@openforce.net - @creation-date Nov 2001 - } { - 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 - @author arjun@openforce.net - @creation-date Nov 2001 - } { - portal::make_datasource_unavailable \ - $portal_id [portal::get_datasource_id [my_name]] - } } Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl 29 Mar 2002 19:20:49 -0000 1.5 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl 9 May 2002 23:59:52 -0000 1.6 @@ -16,10 +16,7 @@ ad_library { - Procedures to supports the dotlrn "members" portlet - - Copyright Openforce, Inc. - Licensed under GNU GPL v2 + Procedures to support the dotlrn "members" portlet @author arjun@openforce.net @cvs-id $Id$ @@ -28,7 +25,7 @@ namespace eval dotlrn_members_portlet { - ad_proc -private my_name { + ad_proc -private get_my_name { } { return "dotlrn_members_portlet" } @@ -54,23 +51,23 @@ portal_id community_id } { - + Adds the dotlrn "members" portlet to the given portal. + Pass along the community_id } { - return [portal::add_element_or_append_id \ - -pretty_name [get_pretty_name] \ - -portal_id $portal_id \ - -page_id $page_id \ - -portlet_name [my_name] \ - -value_id $community_id \ - -key community_id ] + set element_id [portal::add_element \ + -pretty_name [get_pretty_name] \ + -portal_id $portal_id \ + -page_id $page_id \ + -portlet_name [get_my_name] + ] + + portal::set_element_param $element_id "community_id" $community_id + return $element_id } ad_proc -public show { cf } { - Call the template to display - - @param cf A config array } { portal::show_proc_helper \ -package_key [my_package_key] \ @@ -80,45 +77,13 @@ ad_proc -public remove_self_from_page { portal_id - community_id } { - Removes the PE from the given page + Removes the dotlrn "memebers" PE from the given portal } { - # get the element IDs (could be more than one!) - set element_ids [portal::get_element_ids_by_ds $portal_id [my_name]] - - # remove all elements - db_transaction { - foreach element_id $element_ids { - portal::remove_element $element_id - } - } + portal::remove_element \ + -portal_id $portal_id \ + -portlet_name [get_my_name] } - - ad_proc -public edit { - nothing here, move along - } { - return "" - } - - ad_proc -public make_self_available { - portal_id - } { - wrapper - } { - portal::make_datasource_available \ - $portal_id [portal::get_datasource_id [my_name]] - } - - ad_proc -public make_self_unavailable { - portal_id - } { - wrapper - } { - portal::make_datasource_unavailable \ - $portal_id [portal::get_datasource_id [my_name]] - } } - Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.4 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl 9 May 2002 23:59:52 -0000 1.5 @@ -16,19 +16,15 @@ ad_library { - Procedures to supports the dotlrn "members staff" portlet + Procedures to supports the dotlrn "members staff" portlet aka "Staff List" - Copyright Openforce, Inc. - Licensed under GNU GPL v2 - @author arjun@openforce.net @cvs-id $Id$ - } namespace eval dotlrn_members_staff_portlet { - ad_proc -private my_name { + ad_proc -private get_my_name { } { return "dotlrn_members_staff_portlet" } @@ -38,32 +34,48 @@ return "dotlrn-portlet" } - ad_proc -public get_pretty_name { } { return "Staff List" } - ad_proc -public link { } { return "" } - ad_proc -public add_self_to_page { portal_id community_id } { - + Add the "dotlrn members staff" portlet to the page } { - return [portal::add_element_or_append_id \ + set force_region [ad_parameter \ + "dotlrn_members_staff_portlet_force_region" \ + [my_package_key] + ] + + set element_id [portal::add_element \ + -portal_id $portal_id \ -pretty_name [get_pretty_name] \ + -portlet_name [get_my_name] \ + -force_region $force_region + ] + + portal::set_element_param $element_id "community_id" $community_id + + return $element_id + } + + ad_proc -public remove_self_from_page { + portal_id + community_id + } { + Removes the PE from the given page + } { + portal::remove_element \ -portal_id $portal_id \ - -portlet_name [my_name] \ - -force_region 2 \ - -value_id $community_id \ - -key community_id] + -portlet_name [get_my_name] } ad_proc -public show { @@ -79,46 +91,7 @@ -template_src "dotlrn-members-staff-portlet" } - ad_proc -public remove_self_from_page { - portal_id - community_id - } { - Removes the PE from the given page - } { - # get the element IDs (could be more than one!) - set element_ids [portal::get_element_ids_by_ds $portal_id [my_name]] - # remove all elements - db_transaction { - foreach element_id $element_ids { - portal::remove_element $element_id - } - } - } - - ad_proc -public edit { - nothing here, move along - } { - return "" - } - - ad_proc -public make_self_available { - portal_id - } { - wrapper - } { - portal::make_datasource_available \ - $portal_id [portal::get_datasource_id [my_name]] - } - - ad_proc -public make_self_unavailable { - portal_id - } { - wrapper - } { - portal::make_datasource_unavailable \ - $portal_id [portal::get_datasource_id [my_name]] - } } Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl,v diff -u -N -r1.28 -r1.29 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 16 Apr 2002 13:58:28 -0000 1.28 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 9 May 2002 23:59:52 -0000 1.29 @@ -14,23 +14,22 @@ # details. # -# /packages/dotlrn-portlets/tcl/dotlrn-portlets-procs.tcl ad_library { -Procedures to supports dotlrn portlets + Procedures to supports the "dotlrn" portlet. The "dotlrn" portlet shows + the subcommunities of the community's portal where it's located. This portal + is not to be confused with the "dotlrn-main" portal, that goes on user's + workspace portals and shows the communities that they are members of. -Copyright Openforce, Inc. -Licensed under GNU GPL v2 + @creation-date September 30 2001 + @author arjun@openforce.net + @cvs-id $Id$ -@creation-date September 30 2001 -@author arjun@openforce.net -@cvs-id $Id$ - } namespace eval dotlrn_portlet { - ad_proc -private my_name { + ad_proc -private get_my_name { } { return "dotlrn_portlet" } @@ -40,116 +39,57 @@ return "dotlrn-portlet" } - ad_proc -public get_pretty_name { } { - return [ad_parameter -package_id [dotlrn::get_package_id] subcommunities_pretty_plural] - + # get the param from the dotlrn package + return [ad_parameter subcommunities_pretty_plural dotlrn] } ad_proc -public link { } { return "" } - ad_proc -public add_self_to_page { portal_id community_id } { - Adds a dotlrn PE to the given page with the community_id as - opaque data in the portal configuration. + Adds a dotlrn PE to the given communities's portal + @param portal_id + @param community_id @return element_id The new element's id - @param portal_id The page to add self to - @param community_id The dotlrn community to show info about - @author arjun@openforce.net - @creation-date Sept 2001 } { - # Tell portal to add this element to the page set element_id [portal::add_element \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ -pretty_name [get_pretty_name] \ - -force_region 2 \ - $portal_id \ - [my_name]] - - # The default param must be configured - set key "community_id" - # set value [portal::get_element_param $element_id $key] + -force_region [ad_parameter "dotlrn_portlet_force_region" [my_package_key]] + ] - portal::set_element_param $element_id $key $community_id + portal::set_element_param $element_id "community_id" $community_id return $element_id } ad_proc -public show { cf } { - Call the template to display - - @param cf A config array - @author arjun@openforce.net } { portal::show_proc_helper \ -package_key [my_package_key] \ -config_list $cf - } ad_proc -public remove_self_from_page { portal_id - community_id } { - Removes a dotlrn 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 the dotlrn PE from the portal. } { - # get the element IDs (could be more than one!) - set element_ids [portal::get_element_ids_by_ds $portal_id [my_name]] - - # remove all elements - db_transaction { - foreach element_id $element_ids { - portal::remove_element $element_id - } - } + # since there can be only one dotlrn pe on the portal use: + portal::remove_element \ + -portal_id $portal_id \ + -portlet_name [get_my_name] } - ad_proc -public edit { - nothing here, move along - } { - return "" - } - - ad_proc -public make_self_available { - portal_id - } { - Wrapper for the portal:: proc - - @param portal_id - @author arjun@openforce.net - @creation-date Nov 2001 - } { - 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 - @author arjun@openforce.net - @creation-date Nov 2001 - } { - portal::make_datasource_unavailable \ - $portal_id [portal::get_datasource_id [my_name]] - } } - - - Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.adp,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.adp 7 May 2002 22:06:12 -0000 1.10 +++ openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.adp 9 May 2002 23:59:52 -0000 1.11 @@ -22,7 +22,7 @@