Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 9 Nov 2001 03:05:31 -0000 1.18 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 9 Nov 2001 03:56:43 -0000 1.19 @@ -96,6 +96,34 @@ # Not sure what to do here yet } + ad_proc -public get_allowed_rel_types { + { -community_type "" } + { -community_id "" } + } { + if {[empty_string_p $community_type]} { + set community_type [get_community_type_from_community_id $community_id] + } + + if {$community_type == "dotlrn_class"} { + return { + {dotlrn_student_rel Student} + {dotlrn_ta_rel TA} + {dotlrn_instructor_rel Instructor} + {dotlrn_admin_rel Admin} + } + } + + if {$community_type == "dotlrn_club"} { + return { + {dotlrn_member_rel Member} + {dotlrn_admin_rel Admin} + } + } + + return {} + } + + ad_proc -public get_pretty_rel_type { rel_type } { @@ -245,6 +273,14 @@ return [db_list_of_lists select_all_communities {}] } + ad_proc -public get_community_type_from_community_id { + community_id + } { + returns the community type from community_id + } { + return [db_string select_community_type {}] + } + ad_proc -public get_community_type { } { Returns the community type key depending on the node we're at