Index: openacs-4/packages/dotlrn/www/community-new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/community-new-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/community-new-2.tcl 6 Oct 2001 18:24:42 -0000 1.1 +++ openacs-4/packages/dotlrn/www/community-new-2.tcl 7 Oct 2001 19:21:08 -0000 1.2 @@ -17,3 +17,6 @@ # assume it's a class for now set community_id [dotlrn_class::new_instance -description "" $community_type $pretty_name $term $year] + +# redirect +ns_returnredirect [dotlrn_community::get_url -package_id [dotlrn_community::get_package_id $community_id]] Index: openacs-4/packages/dotlrn/www/community-register.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/community-register.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/community-register.tcl 7 Oct 2001 19:21:08 -0000 1.1 @@ -0,0 +1,17 @@ + +ad_page_contract { + register + + @author Ben Adida (ben@openforce.net) + @creation-date 2001-10-06 +} { +} + +ad_maybe_redirect_for_registration + +set user_id [ad_conn user_id] +set community_id [dotlrn_community::get_community_id] + +dotlrn_community::add_user $community_id student_rel $user_id + +ns_returnredirect ./ Index: openacs-4/packages/dotlrn/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/index.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/index.tcl 5 Oct 2001 15:14:29 -0000 1.3 +++ openacs-4/packages/dotlrn/www/index.tcl 7 Oct 2001 19:21:08 -0000 1.4 @@ -14,6 +14,11 @@ return } +if {[ad_parameter community_level_p] == 1} { + ns_returnredirect one-community + return +} + # Select the classes that exist db_multirow classes select_classes {} Index: openacs-4/packages/dotlrn/www/one-community-not-member.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/one-community-not-member.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/one-community-not-member.adp 7 Oct 2001 19:21:08 -0000 1.1 @@ -0,0 +1,5 @@ + +dotLRN Commnity: @pretty_name@ + +You are not a member of this community. Would you like to register? + Index: openacs-4/packages/dotlrn/www/one-community-type.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-type.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/one-community-type.adp 6 Oct 2001 18:24:42 -0000 1.1 +++ openacs-4/packages/dotlrn/www/one-community-type.adp 7 Oct 2001 19:21:08 -0000 1.2 @@ -12,6 +12,20 @@

+ + +No Active Communities of this type + + +

Active Communities of this Type

+ + + +

New Community of this Type

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.1 -r1.2 --- openacs-4/packages/dotlrn/www/one-community-type.tcl 6 Oct 2001 18:24:42 -0000 1.1 +++ openacs-4/packages/dotlrn/www/one-community-type.tcl 7 Oct 2001 19:21:08 -0000 1.2 @@ -28,8 +28,20 @@ # 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 + +# Loop and create the data source (I am very unhappy with db_multirow. VERY - bma) +foreach comm $list_of_active_communities { + template::multirow append active_communities [lindex $comm 0] [lindex $comm 1] [lindex $comm 2] [lindex $comm 3] [lindex $comm 4] +} + ad_return_template Index: openacs-4/packages/dotlrn/www/one-community.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/one-community.tcl 6 Oct 2001 18:24:42 -0000 1.1 +++ openacs-4/packages/dotlrn/www/one-community.tcl 7 Oct 2001 19:21:08 -0000 1.2 @@ -18,9 +18,13 @@ # What community type are we at? set community_id [dotlrn_community::get_community_id] +# Get basic information +db_1row select_community_info {} + # Check that this user is a member -if {[dotlrn_community::member_p $community_id $user_id]} { +if {![dotlrn_community::member_p $community_id $user_id]} { ad_return_template one-community-not-member + return } else { # Pull out the NPP page ID and render it! set page_id [dotlrn_community::get_page_id $community_id $user_id] Index: openacs-4/packages/dotlrn/www/one-community.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/one-community.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/one-community.xql 7 Oct 2001 19:21:08 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + +select pretty_name from dotlrn_communities where community_id = :community_id + + + +