ad_return_url (public)
ad_return_url [ -urlencode ] [ -path_encode ] [ -qualified ] \ [ -default_url default_url ] [ extra_args ]
Defined in packages/acs-tcl/tcl/defs-procs.tcl
Build a return url suitable for passing to a page you expect to return back to the current page. Per default, the result is URL-encoded (like the result of "export_vars" or ":pretty_link").
Example for direct inclusion in a link:
ad_returnredirect "foo?return_url=[ad_return_url]"Example setting a variable to be used by export_vars:set return_url [ad_return_url] set edit_link [export_vars -base edit item_id return_url]Example setting a variable with extra_vars:set return_url [ad_return_url [list [list some_id $some_id] [list some_other_id $some_other_id]]]
- Switches:
- -urlencode (optional, boolean)
- -path_encode (optional, boolean, defaults to
"true"
)- If false do no URL-encode the result
- -qualified (optional, boolean)
- If provided the return URL will be fully qualified including http or https.
- -default_url (optional, defaults to
"."
)- When there is no connection, fall back to this URL
- Parameters:
- extra_args (optional)
- A list of {name value} lists to append to the query string
- Author:
- Don Baccus <dhogaza@pacifier.com>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- login_logout_urls, xowiki_test_cases
Source code: if { $urlencode_p } { ns_log warning "deprecated flag -urlencode; result is encoded per default" } if {[ns_conn isconnected]} { set query_list [export_vars -entire_form] set base_url [ns_conn url] } else { set query_list "" set base_url $default_url } if { $path_encode_p } { set base_url [ns_urlencode $base_url] } if { [llength $query_list] == 0 } { set url $base_url } else { set url "${base_url}?[join $query_list &]" } if {[llength $extra_args] > 0} { # # Deactivate base encode, since the input URL is already # encoded as requested. # set url [export_vars -base $url -no_base_encode $extra_args] } if { $qualified_p } { # Make the return_url fully qualified set url [security::get_qualified_url $url] } return $urlXQL Not present: Generic, PostgreSQL, Oracle