ds_link (public)

 ds_link

Defined in packages/acs-developer-support/tcl/acs-developer-support-procs.tcl

Returns the "Developer Information" link in a right-aligned table, if enabled.

Partial Call Graph (max 5 caller/called nodes):
%3 test_ds_link_test ds_link_test (test acs-developer-support) ds_link ds_link test_ds_link_test->ds_link ad_return_url ad_return_url (public) ds_link->ad_return_url ds_collection_enabled_p ds_collection_enabled_p (public) ds_link->ds_collection_enabled_p ds_enabled_p ds_enabled_p (public) ds_link->ds_enabled_p ds_instance_id ds_instance_id (private) ds_link->ds_instance_id ds_permission_p ds_permission_p (private) ds_link->ds_permission_p

Testcases:
ds_link_test
Source code:

    if { ![ds_enabled_p] && ![ds_user_switching_enabled_p] } {
        return ""
    }

    if { ![ds_permission_p] } {
        return ""
    }

    set out "<div class='developer-support'>"
    if { [ds_enabled_p] && [ds_collection_enabled_p] } {

        set ds_url [ds_support_url]
        if {$ds_url ne ""} {
            append out [subst {
                <a href="$ds_url">Developer Support Home</a> -
                <a href="${ds_url}request-info?request=$::ad_conn(request)">Request Information</a><br>
            }]
        } else {
            ns_log Error "ACS-Developer-Support: Unable to offer link to Developer Support  because it is not mounted anywhere."
        }

        if { [nsv_exists ds_request $::ad_conn(request).db] } {
            set total 0
            set counter 0
            foreach { handle command statement_name sql start end errno error } [nsv_get ds_request $::ad_conn(request).db] {
                set total [expr { $total + ($end - $start) }]
                if { [lindex $command 0] in { dml exec 1row 0or1row select } } {
                    incr counter
                }
            }
            if { $counter > 0 } {
                append out "$counter database command[expr {$counter == 1 ? " taking" : "s totalling"}] [format {%.f} $total] ms<br>"
            }
        }

        if { [nsv_exists ds_request $::ad_conn(request).conn] } {
            array set conn [nsv_get ds_request $::ad_conn(request).conn]
            if { [info exists conn(startclicks)] } {
                set time [format "%.f" [expr { ([clock clicks -microseconds] - $conn(startclicks))/1000.0 }]]
                append out "Page served in $time ms<br>\n"
            }
        }

        if { [parameter::get -package_id [ds_instance_id] -parameter ShowCommentsInlineP -default 0] } {
            set href [export_vars -base ${ds_url}comments-toggle { { return_url [ad_return_url] } }]
            append out [subst {
                Comments: <b>On</b> | <a href="[ns_quotehtml $href]">Off</a><br>
            }]
            if { [nsv_exists ds_request $::ad_conn(request).comment] } {
                foreach comment [nsv_get ds_request $::ad_conn(request).comment] {
                    append out "<b>Comment:</b> $comment<br>\n"
                }
            }
        } else {
            set href [export_vars -base ${ds_url}comments-toggle { { return_url [ad_return_url] } }]
            append out [subst {
                Comments: <a href="[ns_quotehtml $href]">On</a> | <b>Off</b><br>
            }]
        }
    }

    if { [ds_user_switching_enabled_p] } {
        append out [ds_user_select_widget"<br>"
    }

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