template::list::orderby_clause (public)

 template::list::orderby_clause -name name [ -orderby ]

Defined in packages/acs-templating/tcl/list-procs.tcl

Get the order by clause for use in your DB query, or returns the empty string if not sorting in the DB.

Switches:
-name (required)
List name
-orderby (optional, boolean)
If this is specified, this proc will also spit out the "order by" part, so it can be used directly in the query without saying 'order by' yourself.

Partial Call Graph (max 5 caller/called nodes):
%3 packages/acs-admin/www/apm/version-parameters.tcl packages/acs-admin/ www/apm/version-parameters.tcl template::list::orderby_clause template::list::orderby_clause packages/acs-admin/www/apm/version-parameters.tcl->template::list::orderby_clause packages/acs-subsite/www/admin/system/db-stats.tcl packages/acs-subsite/ www/admin/system/db-stats.tcl packages/acs-subsite/www/admin/system/db-stats.tcl->template::list::orderby_clause packages/acs-subsite/www/admin/system/db-table-data.tcl packages/acs-subsite/ www/admin/system/db-table-data.tcl packages/acs-subsite/www/admin/system/db-table-data.tcl->template::list::orderby_clause packages/acs-templating/www/scripts/xinha/file-selector.tcl packages/acs-templating/ www/scripts/xinha/file-selector.tcl packages/acs-templating/www/scripts/xinha/file-selector.tcl->template::list::orderby_clause packages/categories/lib/contributions.tcl packages/categories/ lib/contributions.tcl packages/categories/lib/contributions.tcl->template::list::orderby_clause ad_page_contract_handle_datasource_error ad_page_contract_handle_datasource_error (public) template::list::orderby_clause->ad_page_contract_handle_datasource_error ad_script_abort ad_script_abort (public) template::list::orderby_clause->ad_script_abort template::list::get_reference template::list::get_reference (public) template::list::orderby_clause->template::list::get_reference template::list::orderby::get_reference template::list::orderby::get_reference (public) template::list::orderby_clause->template::list::orderby::get_reference

Testcases:
No testcase defined.
Source code:
    # Get an upvar'd reference to list_properties
    get_reference -name $name

    if { $list_properties(orderby_selected_name) eq "" } {
        return {}
    }

    set result {}
    template::list::orderby::get_reference -list_name $name -orderby_name $list_properties(orderby_selected_name)

    if {![info exists orderby_properties(orderby_$list_properties(orderby_selected_direction))]} {
        ad_page_contract_handle_datasource_error "invalid value for orderby: $list_properties(orderby_selected_direction)"
        ad_script_abort
    }
    set result $orderby_properties(orderby_$list_properties(orderby_selected_direction))

    if { $orderby_p && $result ne "" } {
        set result "order by $result"
    }

    return $result
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: