Index: openacs-4/packages/dotlrn/www/dotlrn-main-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/dotlrn-main-portlet.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/dotlrn-main-portlet.tcl 21 Jan 2002 07:47:09 -0000 1.1 +++ openacs-4/packages/dotlrn/www/dotlrn-main-portlet.tcl 23 Jan 2002 00:15:43 -0000 1.2 @@ -1,29 +1,28 @@ # dotlrn/www/dotlrn-main-portlet-procs.tcl + ad_page_contract { The display logic for the dotlrn main (Groups) portlet @author Arjun Sanyal (arjun@openforce.net) - @cvs_id $Id$ + @version $Id$ } -array set config $cf +set user_id [ad_conn user_id] -set user_id [ad_get_user_id] -set list_of_communities [dotlrn_community::get_all_communities_by_user $user_id] -set my_community_id [lindex $list_of_communities 0] +set sql { + select dotlrn_communities.community_id, + dotlrn_communities.community_type, + dotlrn_communities.community_key, + dotlrn_communities.pretty_name, + dotlrn_communities.package_id + from dotlrn_communities, + dotlrn_member_rels_full + where dotlrn_communities.community_id = dotlrn_member_rels_full.community_id + and dotlrn_member_rels_full.user_id = :user_id +} -db_multirow -local communities select_communities " -select dotlrn_communities.community_id, -dotlrn_communities.community_type, -dotlrn_communities.community_key, -dotlrn_communities.pretty_name, -dotlrn_communities.package_id -from dotlrn_communities, -dotlrn_member_rels_full -where dotlrn_communities.community_id = dotlrn_member_rels_full.community_id -and dotlrn_member_rels_full.user_id = :user_id" { -# ad_return_complaint 1 "aks [info locals] ${communities(package_id)}" - set communities(url) [dotlrn_community::get_url_from_package_id -package_id ${communities(package_id)} ] +db_multirow -local communities select_communities $sql { + set communities(url) [dotlrn_community::get_url_from_package_id -package_id ${communities(package_id)}] } ad_return_template