Index: openacs.org-dev/packages/acs-tcl/tcl/table-display-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/acs-tcl/tcl/table-display-procs.tcl,v diff -u -r1.1.1.1 -r1.1.1.2 --- openacs.org-dev/packages/acs-tcl/tcl/table-display-procs.tcl 9 Jul 2002 17:34:59 -0000 1.1.1.1 +++ openacs.org-dev/packages/acs-tcl/tcl/table-display-procs.tcl 8 Oct 2002 15:46:50 -0000 1.1.1.2 @@ -57,7 +57,7 @@ set url [ad_conn url] } - append html "\n\n" + append html "
\n\n" foreach option $option_list { append html " \n" @@ -67,7 +67,7 @@ append html "\n" foreach option $option_list { - append html " \n" - } else { - set Trow_default "\n" - } - } else { - set Trow_default "\n" - } + 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 ] + } + # 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]]} { + append Trow_default " bgcolor=[lindex $Tband_colors $Tband_color]" + } + if {$Tn_band_classes && ![empty_string_p [lindex $Tband_classes $Tband_class]]} { + append Trow_default " class=\"[lindex $Tband_classes $Tband_class]\"" + } + + set Trow_default "" + append Thtml [subst $Trow_code] foreach Ti $Tcolumn_list { @@ -450,12 +456,12 @@ set Tcolumn [lindex $Tcol 0] switch $Tformat { "" {set Tdisplay_field " \n"} - r {set Tdisplay_field " \n"} - l {set Tdisplay_field " \n"} - c {set Tdisplay_field " \n"} - tf {set Tdisplay_field " \n"} - 01 {set Tdisplay_field " \n"} - bz {set Tdisplay_field " \n"} + r {set Tdisplay_field " \n"} + l {set Tdisplay_field " \n"} + c {set Tdisplay_field " \n"} + tf {set Tdisplay_field " \n"} + 01 {set Tdisplay_field " \n"} + bz {set Tdisplay_field " \n"} default {set Tdisplay_field " [subst $Tformat]\n"} } @@ -561,11 +567,11 @@ } } -proc_doc ad_table_span {str {td_html "align=left"}} { +proc_doc ad_table_span {str {td_html "align=\"left\""}} { given string the function generates a row which spans the whole table. } { - return "" + return "" } proc_doc ad_table_form {datadef {type select} {return_url {}} {item_group {}} {item {}} {columns {}} {allowed {}}} { @@ -592,9 +598,9 @@ # now spit out the form fragment. if {![empty_string_p $item]} { append html "

Editing $item

" - append html "" - append html "" - append html "" + append html "" + append html "" + append html "" append html "[export_form_vars item_group item]" if {![empty_string_p $return_url]} { append html "[export_form_vars return_url]" @@ -614,13 +620,13 @@ if {![empty_string_p $item]} { set item_original $item append html "[export_form_vars item_original]" - append html "" + append html "" } else { - append html "" + append html "" } append html "
[lindex $option 1]
\[" + append html " \[" # find out what the current option value is. # check if a default is set otherwise the first value is used @@ -190,11 +190,12 @@ -Taudit {} -Trows_per_band 1 -Tband_colors {{} {"#ececec"}} + -Tband_classes {{even} {odd}} -Trows_per_page 0 -Tmax_rows 0 - -Ttable_extra_html {} - -Theader_row_extra {bgcolor="#f8f8f8"} - -Ttable_break_html "

" + -Ttable_extra_html {cellpadding=3 cellspacing=0 class="table-display"} + -Theader_row_extra {bgcolor="#f8f8f8" class="table-header"} + -Ttable_break_html "

" -Tpre_row_code {} -Trow_code {[subst $Trow_default]} -Tpost_data_ns_sets {} @@ -256,14 +257,14 @@ set table_def { {ffn "Full Name" {upper(last_name) $order, upper(first_names) $order} - {<td><a href="/admin/users/one.tcl?user_id=$user_id">$first_names $last_name</a></td>}} + {<td><a href="/admin/users/one?user_id=$user_id">$first_names $last_name</a></td>}} {email "e-Mail" {} {<td><a href="mailto:$email">$email</a>}} {email_bouncing_p "e-Bouncing?" {} tf} {user_state "State" {} {}} {last_visit "Last Visit" {} r} {actions "Actions" no_sort {<td> - <a href="/admin/users/basic-info-update.tcl?user_id=$user_id">Edit Info</a> | - <a href="/admin/users/password-update.tcl?user_id=$user_id">New Password</a> | + <a href="/admin/users/basic-info-update?user_id=$user_id">Edit Info</a> | + <a href="/admin/users/password-update?user_id=$user_id">New Password</a> | [ad_registration_finite_state_machine_admin_links $user_state $user_id]}} } @@ -281,7 +282,9 @@ set Tband_count 0 set Tpage_count 0 set Tband_color 0 + set Tband_class 0 set Tn_bands [llength $Tband_colors] + set Tn_band_classes [llength $Tband_classes] set Tform [ad_conn form] # export variables from calling environment @@ -418,28 +421,31 @@ if { $Trows_per_page && $Tpage_count >= $Trows_per_page } { set Tband_color 0 + set Tband_class 0 set Tband_count 0 set Tpage_count 0 } + set Trow_default {} # generate the row band color - if { $Tn_bands } { - if { $Tband_count >= $Trows_per_band } { - set Tband_count 0 - set Tband_color [expr ($Tband_color + 1) % $Tn_bands ] - } - # do this check since we would like the ability to band with - # page background as well - if {[empty_string_p [lindex $Tband_colors $Tband_color]]} { - set Trow_default "

[set $Tcolumn][set $Tcolumn][set $Tcolumn][set $Tcolumn][util_PrettyBoolean [set $Tcolumn]][util_PrettyTclBoolean [set $Tcolumn]] [blank_zero [set $Tcolumn]][set $Tcolumn][set $Tcolumn][set $Tcolumn][util_PrettyBoolean [set $Tcolumn]][util_PrettyTclBoolean [set $Tcolumn]] [blank_zero [set $Tcolumn]]
$str
$str
" - append html "" + append html "" if {![empty_string_p $item]} { set item_original item append html "[export_form_vars item_original]" @@ -629,15 +635,15 @@ if {[string compare $type select] == 0} { # select table - set options "" foreach opt $sel_list { - append options " " } for {set i 0} { $i < $max_columns} {incr i} { if {$i < $n_sel_columns} { set match [lindex [lindex $datadef [lindex $sel_columns $i]] 0] - regsub "(" + append options "" } for {set i 0} { $i < $max_columns} {incr i} { if {$i < $n_sel_columns} { set match [lindex [lindex $datadef [lindex $sel_columns $i]] 0] - regsub "( type=radio )(value=\"$match\">)" $options "\\1 checked \\2" out + regsub "( type=\"radio\" )(value=\"$match\">)" $options "\\1 checked=\"checked\" \\2" out } else { set out $options } @@ -717,9 +723,9 @@ # now spit out the form fragment. if {![empty_string_p $item]} { append html "

Editing $item

" - append html "" - append html "" - append html "" + append html "" + append html "" + append html "" append html "[export_form_vars item_group item]" if {![empty_string_p $return_url]} { append html "[export_form_vars return_url]" @@ -739,38 +745,38 @@ if {![empty_string_p $item]} { set item_original $item append html "[export_form_vars item_original]" - append html "" + append html "" } else { - append html "" + append html "" } append html "
Name:
Name:
" - append html "" + append html "" if {![empty_string_p $item]} { set item_original item append html "[export_form_vars item_original]" append html "" } - set options "" foreach opt $sel_list { - append options " " } for {set i 0} { $i < $max_columns} {incr i} { if {$i < $n_sel_columns} { set match [lindex $sel_columns $i] - regsub "(\n"
Name:
Name:
 Editing the name will rename the sort
[expr $i + 1]" switch [lindex $direction $i] { asc { - append html "" + append html "" } default { - append html "" + append html "" } } @@ -934,7 +940,7 @@ set pre {&} } ad_returnredirect $redirect - return -code return + ad_script_abort } # we have a form so stuff in the ones we dont find. @@ -949,7 +955,7 @@ proc_doc ad_custom_form {return_url item_group item} { sets up the head of a form to feed to /tools/form-custom.tcl } { - append html "\n" + append html "\n" if {![empty_string_p $return_url]} { append html "[export_form_vars return_url]\n" } @@ -958,7 +964,7 @@ } set item_original $item append html "[export_form_vars item_group item item_original]\n" - append html "" + append html "" } proc_doc ad_dimensional_settings {define current} { @@ -968,9 +974,9 @@ NB...this does not close either the table or the form... } { foreach opt $define { - append html "
[lindex $opt 1]" - append html "
[lindex $opt 1]" + append html "