ad_table (public, deprecated)

 ad_table [ -Torder_target_url Torder_target_url ] \
    [ -Torderby Torderby ] [ -Tasc_order_img Tasc_order_img ] \
    [ -Tdesc_order_img Tdesc_order_img ] \
    [ -Tmissing_text Tmissing_text ] [ -Tsuffix Tsuffix ] \
    [ -Tcolumns Tcolumns ] [ -Taudit Taudit ] \
    [ -Trows_per_band Trows_per_band ] [ -Tband_colors Tband_colors ] \
    [ -Tband_classes Tband_classes ] \
    [ -Trows_per_page Trows_per_page ] [ -Tmax_rows Tmax_rows ] \
    [ -Ttable_extra_html Ttable_extra_html ] \
    [ -Theader_row_extra Theader_row_extra ] \
    [ -Ttable_break_html Ttable_break_html ] \
    [ -Tpre_row_code Tpre_row_code ] [ -Trow_code Trow_code ] \
    [ -Tpost_data_ns_sets Tpost_data_ns_sets ] \
    [ -Textra_vars Textra_vars ] [ -Textra_rows Textra_rows ] \
    [ -bind bind ] [ -dbn dbn ] statement_name sql_qry Tdatadef

Defined in packages/acs-tcl/tcl/deprecated-procs.tcl

Deprecated. Invoking this procedure generates a warning.

DRB: New code should use the listbuilder. Note: all the variables in this function are named Tblah since we could potentially have namespace collisions

build and return an HTML fragment given an active query and a data definition.

  • sql_qry -- The query that should be executed to generate the table.
    You can specify an optional -bind argument to specify an ns_set of bind variables.
  • Tdatadef -- the table declaration.
Datadef structure :
    {
        {column_id "Column_Heading" order_clause display_info}
        ...
    }
    
  • column_id -- what to set as orderby for sorting and also is the default variable for the table cell.
  • the text for the heading to be wrapped in <th> and </th> tags. I am not entirely happy that things are wrapped automatically since you might not want plain old th tags but I also don;t want to add another field in the structure.
  • order_clause -- the order clause for the field. If null it defaults to "column_id $order". It is also interpolated, with orderby and order defined as variables so that:
                 {upper(last_name) $order, upper(first_names) $order}
             
    would do the right thing.

    the value "no_sort" should be used for columns which should not allow sorting.

    the value "sort_by_pos" should be used if the columns passed in are column positions rather than column names.

  • display_info. If this is a null string you just default to generating <td>column_id</td>. If it is a string in the lookup list then special formatting is applied; this is l r c tf 01 for align=left right center, Yes/No (from tf), Yes/No from 0/1.

    if the display stuff is not any of the above then it is interpolated and the results returned (w/o any <td> tags put in). An example:

        set table_def {
            {ffn "Full Name"
                {upper(last_name) $order, upper(first_names) $order}
                {<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?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]}}
        }
        

Switches:
-Torder_target_url (optional)
-Torderby (optional)
-Tasc_order_img (optional, defaults to "^")
-Tdesc_order_img (optional, defaults to "v")
-Tmissing_text (optional, defaults to "<em>No data found.</em>")
-Tsuffix (optional)
-Tcolumns (optional)
-Taudit (optional)
-Trows_per_band (optional, defaults to "1")
-Tband_colors (optional, defaults to "{} "#ececec"")
-Tband_classes (optional, defaults to "{even} {odd}")
-Trows_per_page (optional, defaults to "0")
-Tmax_rows (optional, defaults to "0")
-Ttable_extra_html (optional, defaults to "cellpadding=3 cellspacing=0 class="table-display"")
-Theader_row_extra (optional, defaults to "style="background-color:#f8f8f8" class="table-header"")
-Ttable_break_html (optional, defaults to "<br><br>")
-Tpre_row_code (optional)
-Trow_code (optional, defaults to "[subst $Trow_default]")
-Tpost_data_ns_sets (optional)
-Textra_vars (optional)
-Textra_rows (optional)
-bind (optional)
-dbn (optional)
The database name to use. If empty_string, uses the default database.
Parameters:
statement_name (required)
sql_qry (required)
Tdatadef (required)
See Also:

Testcases:
No testcase defined.
[ show source ]
Show another procedure: