Index: openacs-4/packages/dotlrn/dotlrn.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v
diff -u -r1.109 -r1.110
--- openacs-4/packages/dotlrn/dotlrn.info 18 Sep 2003 16:21:35 -0000 1.109
+++ openacs-4/packages/dotlrn/dotlrn.info 19 Sep 2003 10:20:00 -0000 1.110
@@ -51,9 +51,9 @@
-
-
-
+
+
+
@@ -62,7 +62,7 @@
-
+
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 -r1.69 -r1.70
--- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 18 Sep 2003 15:03:11 -0000 1.69
+++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 19 Sep 2003 10:20:00 -0000 1.70
@@ -346,17 +346,16 @@
@param portal_id
} {
+ set type [dotlrn::get_type_from_portal_id -portal_id $portal_id]
+
set args [ns_set create]
ns_set put $args calendar_id 0
- ns_set put $args full_portlet_page_name [get_community_default_page]
+ ns_set put $args full_portlet_page_name [get_default_page $type]
ns_set put $args scoped_p f
- set type [dotlrn::get_type_from_portal_id -portal_id $portal_id]
-
if {[string equal $type "user"]} {
# the portlet has a special name on a user portal
ns_set put $args pretty_name "#dotlrn-calendar.Day_Summary#"
- ns_set put $args full_portlet_page_name [get_user_default_page]
ns_set put $args scoped_p t
} else {
# add this portlet to all types of communities
@@ -480,15 +479,27 @@
return [portal::get_element_param $element_id "calendar_id"]
}
- ad_proc -public get_user_default_page {} {
- The "full calendar" portlet must go on this page of a user's portal
+ ad_proc -private get_default_page { portal_type } {
+ The pretty name of the page to add the portlet to.
} {
- return "#dotlrn.user_portal_page_calendar_title#"
- }
+ switch $portal_type {
+ user {
+ set page_name "#dotlrn.user_portal_page_calendar_title#"
+ }
+ dotlrn_community {
+ set page_name "#dotlrn.subcomm_page_calendar_title#"
+ }
+ dotlrn_class_instance {
+ set page_name "#dotlrn.class_page_calendar_title#"
+ }
+ dotlrn_club {
+ set page_name "#dotlrn.club_page_calendar_title#"
+ }
+ default {
+ ns_log Error "dotlrn-calendar applet: Don't know page name to add portlet to for portal type $portal_type"
+ }
+ }
- ad_proc -public get_community_default_page {} {
- The "full calendar" portlet must go on this page of a comm's portal
- } {
- return "#dotlrn.club_page_calendar_title#"
+ return $page_name
}
}
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 -r1.37 -r1.38
--- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 18 Sep 2003 16:21:35 -0000 1.37
+++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 19 Sep 2003 10:20:00 -0000 1.38
@@ -106,13 +106,13 @@
dotlrn_members_portlet::add_self_to_page \
-portal_id $portal_id \
-community_id $community_id \
- -page_name [members_subcomm_default_page]
+ -page_name [get_default_page $type]
}
default {
dotlrn_members_portlet::add_self_to_page \
-portal_id $portal_id \
-community_id $community_id \
- -page_name [members_community_default_page]
+ -page_name [get_default_page $type]
}
}
@@ -209,13 +209,13 @@
dotlrn_members_portlet::add_self_to_page \
-portal_id $portal_id \
-community_id $community_id \
- -page_name [members_subcomm_default_page]
+ -page_name [get_default_page $type]
}
dotlrn_club {
dotlrn_members_portlet::add_self_to_page \
-portal_id $portal_id \
-community_id $community_id \
- -page_name [members_community_default_page]
+ -page_name [get_default_page $type]
}
dotlrn_class_instance {
dotlrn_members_staff_portlet::add_self_to_page \
@@ -226,7 +226,7 @@
dotlrn_members_portlet::add_self_to_page \
-portal_id $portal_id \
-community_id $community_id \
- -page_name [members_community_default_page]
+ -page_name [get_default_page $type]
}
}
@@ -279,18 +279,29 @@
} {
}
- # misc procs
-
- ad_proc -public members_community_default_page {} {
- Returns the user default page to add the portlet to.
- FIXME Should be a ad_param.
+ ad_proc -private get_default_page { portal_type } {
+ The pretty name of the page to add the portlet to.
} {
- return "#dotlrn.club_page_people_title#"
- }
+ switch $portal_type {
+ user {
+ # Not supposed to be added to user portal, but if anywhere, add on front page
+ set page_name "#dotlrn.user_portal_page_home_title#"
+ }
+ dotlrn_community {
+ set page_name "#dotlrn.subcomm_page_info_title#"
+ }
+ dotlrn_class_instance {
+ # Not supposed to be added to class instance portal, but if anywhere, add on front page
+ set page_name "#dotlrn.class_page_home_title#"
+ }
+ dotlrn_club {
+ set page_name "#dotlrn.club_page_people_title#"
+ }
+ default {
+ ns_log Error "dotlrn-dotlrn applet: Don't know page name to add portlet to for portal type $portal_type"
+ }
+ }
- ad_proc -public members_subcomm_default_page {} {
- FIXME Should be a ad_param.
- } {
- return "#dotlrn.subcomm_page_info_title#"
- }
+ return $page_name
+ }
}
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 -r1.82 -r1.83
--- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 18 Sep 2003 15:03:11 -0000 1.82
+++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 19 Sep 2003 10:20:01 -0000 1.83
@@ -383,15 +383,10 @@
set type [dotlrn::get_type_from_portal_id -portal_id $portal_id]
- if {[string equal $type user]} {
- # the user portal template
- ns_set put $args page_name [get_user_default_page]
- } elseif {[string equal $type dotlrn_community]} {
- # subcom template
- ns_set put $args page_name [get_subcomm_default_page]
- } else {
+ ns_set put $args page_name [get_default_page $type]
+
+ if { [string equal $type dotlrn_class_instance] || [string equal $type dotlrn_club] } {
# club or class template
- ns_set put $args page_name [get_community_default_page]
if {![string equal $type dotlrn_club]} {
# it's a class instance, so add the "Assignments", etc
@@ -705,22 +700,29 @@
-name "[_ dotlrn-fs.lt_new_values_Shared_Fil]"
}
- ad_proc -public get_user_default_page {} {
- return the user default page to add the portlet to
- } {
- return "#dotlrn.user_portal_page_file_storage_title#"
- }
- ad_proc -public get_community_default_page {} {
- return the community (club) default page to add the portlet to
+ ad_proc -private get_default_page { portal_type } {
+ The pretty name of the page to add the portlet to.
} {
- return "#dotlrn.club_page_file_storage_title#"
- }
+ switch $portal_type {
+ user {
+ set page_name "#dotlrn.user_portal_page_file_storage_title#"
+ }
+ dotlrn_community {
+ set page_name "#dotlrn.subcomm_page_file_storage_title#"
+ }
+ dotlrn_class_instance {
+ set page_name "#dotlrn.class_page_file_storage_title#"
+ }
+ dotlrn_club {
+ set page_name "#dotlrn.club_page_file_storage_title#"
+ }
+ default {
+ ns_log Error "dotlrn-fs applet: Don't know page name to add portlet to for portal type $portal_type"
+ }
+ }
- ad_proc -public get_subcomm_default_page {} {
- return the subcomm default page to add the portlet to
- } {
- return "#dotlrn.subcomm_page_file_storage_title#"
+ return $page_name
}
ad_proc -public get_package_id {