ad_return_url (public)

 ad_return_url [ -urlencode ] [ -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.

Example for direct inclusion in a link:

    ad_returnredirect "foo?return_url=[ad_return_url -url_encode]"
    
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 some_id $some_id] [some_other_id $some_other_id]]
    

Switches:
-urlencode (boolean) (optional)
If true URL-encode the result
-qualified (boolean) (optional)
If provided the return URL will be fully qualified including http or https.
-default_url (defaults to ".") (optional)
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):
%3 ::xowiki::Page instproc www-toggle-publish-status ::xowiki::Page instproc www-toggle-publish-status (public) ad_return_url ad_return_url ::xowiki::Page instproc www-toggle-publish-status->ad_return_url ::xowiki::Page instproc www-view ::xowiki::Page instproc www-view (public) ::xowiki::Page instproc www-view->ad_return_url ad_get_login_url ad_get_login_url (public) ad_get_login_url->ad_return_url ad_get_logout_url ad_get_logout_url (public) ad_get_logout_url->ad_return_url ad_restrict_to_https ad_restrict_to_https (public) ad_restrict_to_https->ad_return_url export_entire_form_as_url_vars export_entire_form_as_url_vars (public) ad_return_url->export_entire_form_as_url_vars

Testcases:
No testcase defined.
Source code:

    if {[ns_conn isconnected]} {
        set query_list [export_entire_form_as_url_vars]
        if { [llength $query_list] == 0 } {
            set url [ns_conn url]
        } else {
            set url "[ns_conn url]?[join $query_list &]"
        }
        if { $qualified_p } {
            # Make the return_url fully qualified
            set url [security::get_qualified_url $url]
        }
    } else {
        set query_list ""
        set url $default_url
    }
    foreach {extra_arg} $extra_args {
        lappend query_list [join $extra_arg "="]
    }

    if { $urlencode_p } {
        set url [ns_urlencode $url]
    }
    return $url
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: