Index: openacs-4/packages/acs-tcl/tcl/table-display-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/table-display-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-tcl/tcl/table-display-procs.tcl 28 Aug 2003 09:41:43 -0000 1.11 +++ openacs-4/packages/acs-tcl/tcl/table-display-procs.tcl 10 Jan 2007 21:22:12 -0000 1.12 @@ -45,15 +45,15 @@ } { set html {} - if {[empty_string_p $option_list]} { + if {$option_list eq ""} { return } - if {[empty_string_p $options_set]} { + if {$options_set eq ""} { set options_set [ns_getform] } - if {[empty_string_p $url]} { + if {$url eq ""} { set url [ad_conn url] } @@ -73,10 +73,10 @@ # check if a default is set otherwise the first value is used set option_key [lindex $option 0] set option_val {} - if { ! [empty_string_p $options_set]} { + if { $options_set ne ""} { set option_val [ns_set get $options_set $option_key] } - if { [empty_string_p $option_val] } { + if { $option_val eq "" } { set option_val [lindex $option 2] } @@ -89,7 +89,7 @@ append html " | " } - if {[string compare $option_val $thisoption] == 0} { + if {$option_val eq $thisoption } { append html "[lindex $option_value 1]" } else { append html "[lindex $option_value 1]" @@ -108,11 +108,11 @@ } { set out {} - if {[empty_string_p $option_list]} { + if {$option_list eq ""} { return } - if {[empty_string_p $options_set]} { + if {$options_set eq ""} { set options_set [ns_getform] } @@ -122,20 +122,20 @@ set option_key [lindex $option 0] set option_val {} # get the option from the form - if { ! [empty_string_p $options_set]} { + if { $options_set ne ""} { set option_val [ns_set get $options_set $option_key] } #otherwise get from default - if { [empty_string_p $option_val] } { + if { $option_val eq "" } { set option_val [lindex $option 2] } foreach option_value [lindex $option 3] { set thisoption [lindex $option_value 0] - if {[string compare $option_val $thisoption] == 0} { + if {$option_val eq $thisoption } { set code [lindex $option_value 2] - if {![empty_string_p $code]} { - if {[string compare [lindex $code 0] $what] == 0} { + if {$code ne ""} { + if {[lindex $code 0] eq $what } { append out " $joiner [uplevel [list subst [lindex $code 1]]]" } } @@ -156,11 +156,11 @@ } { set out {} - if {[empty_string_p $option_list]} { + if {$option_list eq ""} { return } - if {[empty_string_p $options_set]} { + if {$options_set eq ""} { set options_set [ns_getform] } @@ -170,7 +170,7 @@ set option_key [lindex $option 0] set option_val {} # get the option from the form - if { ! [empty_string_p $options_set] && [ns_set find $options_set $option_key] != -1} { + if { $options_set ne "" && [ns_set find $options_set $option_key] != -1} { uplevel [list set $option_key [ns_set get $options_set $option_key]] } else { uplevel [list set $option_key [lindex $option 2]] @@ -290,7 +290,7 @@ set Tform [ad_conn form] # export variables from calling environment - if {![empty_string_p $Textra_vars]} { + if {$Textra_vars ne ""} { foreach Tvar $Textra_vars { upvar $Tvar $Tvar } @@ -300,14 +300,14 @@ set Torderbykey {::not_sorted::} set Treverse {} regexp {^([^*,]+)([*])?} $Torderby match Torderbykey Treverse - if {$Treverse == "*"} { + if {$Treverse eq "*"} { set Torder desc } else { set Torder asc } # set up the target url for new sorts - if {[empty_string_p $Torder_target_url]} { + if {$Torder_target_url eq ""} { set Torder_target_url [ad_conn url] } set Texport "[uplevel [list export_ns_set_vars url [list orderby$Tsuffix]]]&" @@ -325,7 +325,7 @@ # generate the header code # append Theader "
[lindex $Tcol 1] | \n" } else { - if {[string compare [lindex $Tcol 0] $Torderbykey] == 0} { - if {$Torder == "desc"} { + if {[lindex $Tcol 0] eq $Torderbykey } { + if {$Torder eq "desc"} { set Tasord $Tasc_order_img } else { set Tasord $Tdesc_order_img @@ -379,7 +379,7 @@ if { $Tpost_data && $Tpost_data <= [llength $Tpost_data_ns_sets] } { # bind the Tpost_data_ns_sets row of the passed in data - set_variables_after_query_not_selection [lindex $Tpost_data_ns_sets [expr $Tpost_data - 1]] + set_variables_after_query_not_selection [lindex $Tpost_data_ns_sets [expr {$Tpost_data - 1}]] } elseif { $Tpost_data } { # past the end of the fake data drop out. break @@ -402,10 +402,10 @@ # first check if we are in audit mode and if the audit columns have changed set Tdisplay_changes_only 0 - if {![empty_string_p $Taudit] && $Tcount > 0} { + if {$Taudit ne "" && $Tcount > 0} { # check if the audit key columns changed foreach Taudit_key $Taudit { - if {[string compare [set $Taudit_key] [set P$Taudit_key]] == 0} { + if {[set $Taudit_key] eq [set P$Taudit_key] } { set Tdisplay_changes_only 1 } } @@ -468,7 +468,7 @@ } if { $Tdisplay_changes_only - && [string compare $Tdisplay_field $Tlast_display($Ti)] == 0} { + && $Tdisplay_field eq $Tlast_display($Ti) } { set Tdisplay_field {} } else { set Tlast_display($Ti) $Tdisplay_field @@ -482,7 +482,7 @@ # so on next row we can say things like if $Pvar != $var not blank if { $Tpost_data && $Tpost_data <= [llength $Tpost_data_ns_sets] } { # bind the Tpost_data_ns_sets row of the passed in data - set_variables_after_query_not_selection [lindex $Tpost_data_ns_sets [expr $Tpost_data - 1]] P + set_variables_after_query_not_selection [lindex $Tpost_data_ns_sets [expr {$Tpost_data - 1}]] P } else { set_variables_after_query_not_selection $selection P } @@ -511,21 +511,21 @@ -sortable from t/f/all } { set column_list {} - if {[empty_string_p $columns]} { + if {$columns eq ""} { for {set i 0} {$i < [llength $datadef]} {incr i} { - if {$sortable == "all" - || ($sortable == "t" && [lindex [lindex $datadef $i] 2] != "no_sort") - || ($sortable == "f" && [lindex [lindex $datadef $i] 2] == "no_sort") + if {$sortable eq "all" + || ($sortable eq "t" && [lindex [lindex $datadef $i] 2] != "no_sort") + || ($sortable eq "f" && [lindex [lindex $datadef $i] 2] == "no_sort") } { lappend column_list $i } } } else { set colnames {} foreach col $datadef { - if {$sortable == "all" - || ($sortable == "t" && [lindex $col 2] != "no_sort") - || ($sortable == "f" && [lindex $col 2] == "no_sort") + if {$sortable eq "all" + || ($sortable eq "t" && [lindex $col 2] ne "no_sort") + || ($sortable eq "f" && [lindex $col 2] eq "no_sort") } { lappend colnames [lindex $col 0] } else { @@ -594,32 +594,32 @@ set n_sel_columns [llength $sel_columns] set html {} - if {[string compare $item "CreateNewCustom"] == 0} { + if {$item eq "CreateNewCustom" } { set item {} } # now spit out the form fragment. - if {![empty_string_p $item]} { + if {$item ne ""} { append html " |
---|