Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.adp,v
diff -u -r1.11.2.1 -r1.11.2.2
--- openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.adp 17 Oct 2002 10:49:03 -0000 1.11.2.1
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.adp 12 Mar 2003 02:35:31 -0000 1.11.2.2
@@ -20,65 +20,70 @@
-<%= [dotlrn_community::get_role_pretty_plural -community_id $community_id -rel_type dotlrn_instructor_rel] %>:
-
-
-
-
- -
- <%= [acs_community_member_link -user_id $users(user_id) -label "$users(first_names) $users(last_name)"] %>
-
- (@users.email@)
+
+ No community was specified
+
+
+ <%= [dotlrn_community::get_role_pretty_plural -community_id $community_id -rel_type dotlrn_instructor_rel] %>:
+
+
+
+
+ -
+ <%= [acs_community_member_link -user_id $users(user_id) -label "$users(first_names) $users(last_name)"] %>
+
+ (@users.email@)
+
-
-
-
-
- - No <%= [dotlrn_community::get_role_pretty_plural -community_id $community_id -rel_type dotlrn_instructor_rel] %>
-
-
+
+
+
+ No <%= [dotlrn_community::get_role_pretty_plural -community_id $community_id -rel_type dotlrn_instructor_rel] %>
+
+
-
+
-<%= [dotlrn_community::get_role_pretty_plural -community_id $community_id -rel_type dotlrn_ta_rel] %>:
-
-
-
-
- -
- <%= [acs_community_member_link -user_id $users(user_id) -label "$users(first_names) $users(last_name)"] %>
-
- (@users.email@)
+ <%= [dotlrn_community::get_role_pretty_plural -community_id $community_id -rel_type dotlrn_ta_rel] %>:
+
+
+
+
+ -
+ <%= [acs_community_member_link -user_id $users(user_id) -label "$users(first_names) $users(last_name)"] %>
+
+ (@users.email@)
+
-
-
-
-
- - No <%= [dotlrn_community::get_role_pretty_plural -community_id $community_id -rel_type dotlrn_ta_rel] %>
-
-
+
+
+
+ No <%= [dotlrn_community::get_role_pretty_plural -community_id $community_id -rel_type dotlrn_ta_rel] %>
+
+
-
+
-<%= [dotlrn_community::get_role_pretty_plural -community_id $community_id -rel_type dotlrn_ca_rel] %>:
-
-
-
-
- -
- <%= [acs_community_member_link -user_id $users(user_id) -label "$users(first_names) $users(last_name)"] %>
-
- (@users.email@)
+ <%= [dotlrn_community::get_role_pretty_plural -community_id $community_id -rel_type dotlrn_ca_rel] %>:
+
+
+
+
+ -
+ <%= [acs_community_member_link -user_id $users(user_id) -label "$users(first_names) $users(last_name)"] %>
+
+ (@users.email@)
+
-
-
-
-
- - No <%= [dotlrn_community::get_role_pretty_plural -community_id $community_id -rel_type dotlrn_ca_rel] %>
-
-
+
+
+
+ No <%= [dotlrn_community::get_role_pretty_plural -community_id $community_id -rel_type dotlrn_ca_rel] %>
+
+
-
-
-Member List
-
+
+
+ Member List
+
+
Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.tcl,v
diff -u -r1.8 -r1.8.2.1
--- openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.tcl 9 Aug 2002 18:39:29 -0000 1.8
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.tcl 12 Mar 2003 02:35:32 -0000 1.8.2.1
@@ -31,28 +31,32 @@
set referer [ad_conn url]
set community_id $config(community_id)
-set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id -community_id $community_id]
-set read_private_data_p [dotlrn::user_can_read_private_data_p -user_id $user_id]
+if { ![string equal $community_id 0] } {
-# get all the users in a list of ns_sets
-set all_users_list [dotlrn_community::list_users $community_id]
+ set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id -community_id $community_id]
+ set read_private_data_p [dotlrn::user_can_read_private_data_p -user_id $user_id]
-set n_profs 0
-set n_tas 0
-set n_cas 0
+ # get all the users in a list of ns_sets
+ set all_users_list [dotlrn_community::list_users $community_id]
-# count how many of some types
-foreach one_user_set $all_users_list {
- if {[string equal [ns_set get $one_user_set rel_type] "dotlrn_instructor_rel"]} {
- incr n_profs
- } elseif {[string equal [ns_set get $one_user_set rel_type] "dotlrn_ta_rel"]} {
- incr n_tas
- } elseif {[string equal [ns_set get $one_user_set rel_type] "dotlrn_ca_rel"]} {
- incr n_cas
+ set n_profs 0
+ set n_tas 0
+ set n_cas 0
+
+ # count how many of some types
+ foreach one_user_set $all_users_list {
+ if {[string equal [ns_set get $one_user_set rel_type] "dotlrn_instructor_rel"]} {
+ incr n_profs
+ } elseif {[string equal [ns_set get $one_user_set rel_type] "dotlrn_ta_rel"]} {
+ incr n_tas
+ } elseif {[string equal [ns_set get $one_user_set rel_type] "dotlrn_ca_rel"]} {
+ incr n_cas
+ }
}
-}
-# stuff into a multirow
-template::util::list_of_ns_sets_to_multirow \
- -rows $all_users_list \
- -var_name "users"
+ # stuff into a multirow
+ template::util::list_of_ns_sets_to_multirow \
+ -rows $all_users_list \
+ -var_name "users"
+
+}
Index: openacs-4/packages/static-portlet/www/static-admin-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/static-admin-portlet.adp,v
diff -u -r1.11 -r1.11.2.1
--- openacs-4/packages/static-portlet/www/static-admin-portlet.adp 9 Aug 2002 18:39:33 -0000 1.11
+++ openacs-4/packages/static-portlet/www/static-admin-portlet.adp 12 Mar 2003 02:34:59 -0000 1.11.2.1
@@ -18,14 +18,19 @@
%>
-
+
+ No community specified
+
+
+
+
Index: openacs-4/packages/static-portlet/www/static-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/static-admin-portlet.tcl,v
diff -u -r1.12.2.1 -r1.12.2.2
--- openacs-4/packages/static-portlet/www/static-admin-portlet.tcl 17 Oct 2002 09:39:47 -0000 1.12.2.1
+++ openacs-4/packages/static-portlet/www/static-admin-portlet.tcl 12 Mar 2003 02:34:59 -0000 1.12.2.2
@@ -31,32 +31,34 @@
set package_id [dotlrn_community::get_community_id]
}
-if {![exists_and_not_null template_portal_id]} {
- set template_portal_id [dotlrn_community::get_portal_id]
-}
+# DRB: when previewing from the portals package no community is defined, we don't
+# want to portlet to bomb in this case.
-if {[exists_and_not_null return_url]} {
- set referer $return_url
-}
+if { ![string equal $package_id ""] } {
-if {![exists_and_not_null referer]} {
- set referer [ad_conn url]
-}
+ if {![exists_and_not_null template_portal_id]} {
+ set template_portal_id [dotlrn_community::get_portal_id]
+ }
-set element_pretty_name [ad_parameter static_admin_portlet_element_pretty_name static-portlet "Custom Portlet"]
-set element_pretty_plural [ad_parameter static_admin_portlet_element_pretty_plural static-portlet "Custom Portlets"]
+ if {[exists_and_not_null return_url]} {
+ set referer $return_url
+ }
-ns_log notice "package_id = $package_id"
-db_multirow content select_content {
- select content_id,
- pretty_name
- from static_portal_content
- where package_id = :package_id
-}
+ if {![exists_and_not_null referer]} {
+ set referer [ad_conn url]
+ }
+ set element_pretty_name [ad_parameter static_admin_portlet_element_pretty_name static-portlet "Custom Portlet"]
+ set element_pretty_plural [ad_parameter static_admin_portlet_element_pretty_plural static-portlet "Custom Portlets"]
-set applet_url "[dotlrn_applet::get_url]/[static_portlet::my_package_key]"
+ ns_log notice "package_id = $package_id"
+ db_multirow content select_content {
+ select content_id,
+ pretty_name
+ from static_portal_content
+ where package_id = :package_id
+ }
+ set applet_url "[dotlrn_applet::get_url]/[static_portlet::my_package_key]"
-
-
+}