Index: openacs-4/packages/acs-templating/tcl/list-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/list-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/tcl/list-procs.tcl 6 Sep 2003 15:21:36 -0000 1.3 +++ openacs-4/packages/acs-templating/tcl/list-procs.tcl 26 Sep 2003 08:10:03 -0000 1.4 @@ -1151,15 +1151,31 @@ } # Does the filter have a current value? - if { [exists_and_not_null current_filter_value] } { + if { [info exists current_filter_value] } { # Get the where clause - if { ![empty_string_p $filter_properties(where_clause)] } { - lappend list_properties(filter_where_clauses) $filter_properties(where_clause) - } elseif { ![empty_string_p $filter_properties(where_clause_eval)] } { - lappend list_properties(filter_where_clauses) [uplevel $list_properties(ulevel) $filter_properties(where_clause_eval)] + if { [empty_string_p $current_filter_value] } { + set search_order { null_where_clause_eval null_where_clause where_clause_eval where_clause } + } else { + set search_order { where_clause_eval where_clause } } + foreach property $search_order { + if { ![empty_string_p $filter_properties($property)] } { + # We've found a where_clause to include + + if { [string match *_eval $property] } { + # It's an _eval, subst it now + lappend list_properties(filter_where_clauses) \ + [uplevel $list_properties(ulevel) $filter_properties($property)] + } else { + # Not an eval, just add it straight + lappend list_properties(filter_where_clauses) $filter_properties($property) + } + break + } + } + # Get the clear_url if { ![template::util::is_true $filter_properties(has_default_p)] } { set filter_properties(clear_url) [get_url \ @@ -1183,6 +1199,10 @@ # because then the foreach loop would run more than once foreach { label value count } [lrange $elm 0 2] {} + if { [empty_string_p $label] } { + set label $filter_properties(null_label) + } + switch $filter_properties(type) { singleval { set selected_p [exists_and_equal current_filter_value $value] @@ -1218,8 +1238,8 @@ switch $filter_properties(type) { singleval - multival { lappend filter_properties(urls) [get_url \ - -name $name \ - -override [list [list $filter_properties(var_spec) $value]]] + -name $name \ + -override [list [list $filter_properties(var_spec) $value]]] } multivar { # We just use the value-list directly @@ -1293,6 +1313,10 @@ # because then the foreach loop would run more than once foreach { label value count } [lrange $elm 0 2] {} + if { [empty_string_p $label] } { + set label $filter_properties(null_label) + } + template::multirow -local append filters \ $filter_properties(name) \ $filter_properties(label) \ @@ -1830,7 +1854,10 @@ default_value {} where_clause {} where_clause_eval {} + null_where_clause {} + null_where_clause_eval {} other_label {} + null_label {} } # Prepopulate some automatically generated values