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.20 -r1.21 --- openacs-4/packages/acs-tcl/tcl/table-display-procs.tcl 13 Feb 2009 20:28:08 -0000 1.20 +++ openacs-4/packages/acs-tcl/tcl/table-display-procs.tcl 27 Oct 2014 16:40:08 -0000 1.21 @@ -6,7 +6,12 @@ # Dimensional selection bars. # -ad_proc ad_dimensional {option_list {url {}} {options_set ""} {optionstype url}} { +ad_proc ad_dimensional { + option_list + {url {}} + {options_set ""} + {optionstype url} +} { Generate an option bar as in the ticket system;
Given what clause we are asking for and the joiner this returns
@@ -179,31 +189,29 @@
}
ad_proc -deprecated ad_table {
- {
- -Torder_target_url {}
- -Torderby {}
- -Tasc_order_img {^}
- -Tdesc_order_img {v}
- -Tmissing_text "No data found."
- -Tsuffix {}
- -Tcolumns {}
- -Taudit {}
- -Trows_per_band 1
- -Tband_colors {{} "#ececec"}
- -Tband_classes {{even} {odd}}
- -Trows_per_page 0
- -Tmax_rows 0
- -Ttable_extra_html {cellpadding=3 cellspacing=0 class="table-display"}
- -Theader_row_extra {style="background-color:#f8f8f8" class="table-header"}
- -Ttable_break_html "
"
- -Tpre_row_code {}
- -Trow_code {[subst $Trow_default]}
- -Tpost_data_ns_sets {}
- -Textra_vars {}
- -Textra_rows {}
- -bind {}
- -dbn {}
- }
+ {-Torder_target_url {}}
+ {-Torderby {}}
+ {-Tasc_order_img {^}}
+ {-Tdesc_order_img {v}}
+ {-Tmissing_text "No data found."}
+ {-Tsuffix {}}
+ {-Tcolumns {}}
+ {-Taudit {}}
+ {-Trows_per_band 1}
+ {-Tband_colors {{} "#ececec"}}
+ {-Tband_classes {{even} {odd}}}
+ {-Trows_per_page 0}
+ {-Tmax_rows 0}
+ {-Ttable_extra_html {cellpadding=3 cellspacing=0 class="table-display"}}
+ {-Theader_row_extra {style="background-color:#f8f8f8" class="table-header"}}
+ {-Ttable_break_html "
"}
+ {-Tpre_row_code {}}
+ {-Trow_code {[subst $Trow_default]}}
+ {-Tpost_data_ns_sets {}}
+ {-Textra_vars {}}
+ {-Textra_rows {}}
+ {-bind {}}
+ {-dbn {}}
statement_name sql_qry Tdatadef
} {
@@ -336,10 +344,8 @@
foreach Ti $Tcolumn_list {
set Tcol [lindex $Tdatadef $Ti]
if { ( [ns_set find $selection [lindex $Tcol 0]] < 0
- && ([empty_string_p [lindex $Tcol 2]] ||
- ([lindex $Tcol 2] ne "sort_by_pos" )
- )
- )
+ && ([lindex $Tcol 2] eq "" || [lindex $Tcol 2] ne "sort_by_pos")
+ )
|| [lindex $Tcol 2] eq "no_sort"
} {
@@ -382,7 +388,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 $Tpost_data-1]
} elseif { $Tpost_data } {
# past the end of the fake data drop out.
break
@@ -436,15 +442,15 @@
# generate the row band color
if { $Tband_count >= $Trows_per_band } {
set Tband_count 0
- set Tband_color [expr ($Tband_color + 1) % $Tn_bands ]
- set Tband_class [expr ($Tband_class + 1) % $Tn_band_classes ]
+ set Tband_color [expr {($Tband_color + 1) % $Tn_bands} ]
+ set Tband_class [expr {($Tband_class + 1) % $Tn_band_classes} ]
}
# do this check since we would like the ability to band with
# page background as well
- if {$Tn_bands && ![empty_string_p [lindex $Tband_colors $Tband_color]]} {
+ if {$Tn_bands && [lindex $Tband_colors $Tband_color] ne ""} {
append Trow_default " style=\"background-color:[lindex $Tband_colors $Tband_color]\""
}
- if {$Tn_band_classes && ![empty_string_p [lindex $Tband_classes $Tband_class]]} {
+ if {$Tn_band_classes && [lindex $Tband_classes $Tband_class] ne ""} {
append Trow_default " class=\"[lindex $Tband_classes $Tband_class]\""
}
@@ -485,7 +491,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 $Tpost_data-1] P
} else {
set_variables_after_query_not_selection $selection P
}
@@ -501,10 +507,8 @@
return $Thtml
}
-ad_proc ad_table_column_list {
- {
- -sortable all
- }
+ad_proc -deprecated ad_table_column_list {
+ { -sortable all }
datadef columns
} {
build a list of pointers into the list of column definitions
@@ -517,8 +521,8 @@
if {$columns eq ""} {
for {set i 0} {$i < [llength $datadef]} {incr i} {
if {$sortable eq "all"
- || ($sortable eq "t" && [lindex [lindex $datadef $i] 2] != "no_sort")
- || ($sortable eq "f" && [lindex [lindex $datadef $i] 2] == "no_sort")
+ || ($sortable == "t" && [lindex $datadef $i 2] ne "no_sort")
+ || ($sortable == "f" && [lindex $datadef $i 2] eq "no_sort")
} {
lappend column_list $i
}
@@ -527,8 +531,8 @@
set colnames {}
foreach col $datadef {
if {$sortable eq "all"
- || ($sortable eq "t" && [lindex $col 2] ne "no_sort")
- || ($sortable eq "f" && [lindex $col 2] eq "no_sort")
+ || ($sortable == "t" && [lindex $col 2] ne "no_sort")
+ || ($sortable == "f" && [lindex $col 2] eq "no_sort")
} {
lappend colnames [lindex $col 0]
} else {
@@ -547,7 +551,7 @@
return $column_list
}
-ad_proc ad_sort_primary_key orderby {
+ad_proc -deprecated ad_sort_primary_key {orderby} {
return the primary (first) key of an order spec
used by
} {
@@ -557,7 +561,7 @@
return $orderby
}
-ad_proc ad_table_same varname {
+ad_proc -deprecated ad_table_same varname {
Called from inside ad_table.
returns true if the variable has same value as
@@ -572,14 +576,22 @@
}
}
-ad_proc ad_table_span {str {td_html "align=\"left\""}} {
+ad_proc -deprecated ad_table_span {str {td_html "align=\"left\""}} {
given string the function generates a row which spans the
whole table.
} {
return "
columns is a list of the currently selected columns. @@ -606,25 +618,25 @@ append html "
" } append html "