Index: openacs-4/packages/dotlrn/www/one-community-type.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-type.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/www/one-community-type.tcl 27 Nov 2001 23:32:03 -0000 1.5 +++ openacs-4/packages/dotlrn/www/one-community-type.tcl 1 Dec 2001 23:16:27 -0000 1.6 @@ -23,21 +23,13 @@ # Check what communities of this type the user is a member of # cause we want to display that! -set list_of_communities [dotlrn_community::get_communities_by_user $community_type $user_id] +set member_communities [dotlrn_community::get_communities_by_user $community_type $user_id] -# communities should be a data source -template::multirow create communities community_id community_type pretty_name description url - -# Loop and create the data source (I am very unhappy with db_multirow. VERY - bma) -foreach comm $list_of_communities { - template::multirow append communities [lindex $comm 0] [lindex $comm 1] [lindex $comm 2] [lindex $comm 3] [lindex $comm 4] -} - # Load all active communities for this community type set list_of_active_communities [dotlrn_community::get_active_communities $community_type] # data source -template::multirow create active_communities community_id community_type pretty_name description url admin_p +template::multirow create active_communities community_id community_type pretty_name description url admin_p member_p # Loop and create the data source (I am very unhappy with db_multirow. VERY - bma) foreach comm $list_of_active_communities { @@ -48,7 +40,13 @@ set admin_p 0 } - template::multirow append active_communities [lindex $comm 0] [lindex $comm 1] [lindex $comm 2] [lindex $comm 3] [lindex $comm 4] $admin_p + if {[lsearch [lindex $comm 0] $member_communities]} { + set member_p 1 + } else { + set member_p 0 + } + + template::multirow append active_communities [lindex $comm 0] [lindex $comm 1] [lindex $comm 2] [lindex $comm 3] [lindex $comm 4] $admin_p $member_p } set context_bar {View}