Index: openacs-4/packages/dotlrn/www/dotlrn-main-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/dotlrn-main-portlet.adp,v diff -u -N -r1.37.6.2 -r1.37.6.3 --- openacs-4/packages/dotlrn/www/dotlrn-main-portlet.adp 19 Jul 2004 18:39:39 -0000 1.37.6.2 +++ openacs-4/packages/dotlrn/www/dotlrn-main-portlet.adp 12 Apr 2005 15:37:35 -0000 1.37.6.3 @@ -18,6 +18,7 @@ %> + #dotlrn.lt_JoinDrop_a_Class_or_C# ]

@@ -26,47 +27,24 @@ +@communities.previous_type_ul_tags;noquote@ -<% - set old_level 0 - set new_level 0 - set depth 0 -%> - -

+
  • +

    - <%= [parameter::get -localize -parameter class_instances_pretty_plural] %>: + <%= [parameter::get -localize -parameter class_instances_pretty_plural] %> - <%= [parameter::get -localize -parameter clubs_pretty_plural] %>: + <%= [parameter::get -localize -parameter clubs_pretty_plural] %> -

    +

( ++ | -- ) + +
  • -<% set new_level $communities(tree_level) %> +@communities.intra_type_ul_tags;noquote@ - - <% incr depth -1 %> -
- - <% while {$depth > 1} { - append close_tags "" - incr depth -1 - } - %> - @close_tags;noquote@ - -
- - -<% incr depth 1 %> - -<% - for {set i $depth} {$i > 0} {incr i -1} { - template::adp_puts "\n" - } -%> - +@final_ul_tags;noquote@ + 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 -N -r1.11.6.2 -r1.11.6.3 --- openacs-4/packages/dotlrn/www/dotlrn-main-portlet.tcl 19 Jul 2004 18:39:39 -0000 1.11.6.2 +++ openacs-4/packages/dotlrn/www/dotlrn-main-portlet.tcl 12 Apr 2005 15:37:35 -0000 1.11.6.3 @@ -46,15 +46,59 @@ } set comm_type "" -db_multirow communities select_communities {} { - set tree_level [expr $tree_level - $community_type_level] +set old_depth 0 +set depth 0 +db_multirow -extend {intra_type_ul_tags previous_type_ul_tags} communities select_communities {} { + set intra_type_ul_tags "" + set previous_type_ul_tags "" + set new_type_p 0 if {![string equal $simple_community_type dotlrn_community]} { set comm_type $simple_community_type } else { set simple_community_type $comm_type } + #Checking for existence of old_simple_community_type gives us an + #easy way to detect the first row. Don't pre-define it! + if { ![info exists old_simple_community_type] || + ![string equal $old_simple_community_type $simple_community_type] } { + set base_level $tree_level + set new_type_p 1 + } + if { [info exists old_simple_community_type] && + ![string equal $old_simple_community_type $simple_community_type] } { + append previous_type_ul_tags [string repeat "" $old_depth] + set old_depth 0 + } + + set depth [expr $tree_level - $base_level] + if { $depth > $old_depth } { + append intra_type_ul_tags [string repeat "" [expr $old_depth - $depth]] + append intra_type_ul_tags "
  • " + } + if { $depth == $old_depth && !$new_type_p } { + append intra_type_ul_tags "
  • " + } + + set old_depth $depth + set old_simple_community_type $simple_community_type } +if { $old_depth > 0 } { + set final_ul_tags [string repeat "
  • " $old_depth] +} else { + set final_ul_tags "" +} + set dotlrn_url [dotlrn::get_url] +# Add the dhtml tree javascript to the HEAD. +global dotlrn_master__header_stuff +append dotlrn_master__header_stuff { + + +} + ad_return_template