ad_context_bar_html (public)

 ad_context_bar_html [ -separator separator ] context

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

Generate the an HTML fragment for a context bar. This is the function that takes a list in the format

    [list [list url1 text1] [list url2 text2] ... "terminal text"]
    
    and generates the HTML fragment.  In general, the higher level
    proc ad_context_bar should be
    used, and then only in the sitewide master rather than on
    individual pages.

Switches:
-separator (optional)
The text placed between each link
Parameters:
context (required)
list as with ad_context_bar
Returns:
HTML fragment
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_ad_context_bar_html ad_context_bar_html (test acs-tcl) ad_context_bar_html ad_context_bar_html test_ad_context_bar_html->ad_context_bar_html ad_conn ad_conn (public) ad_context_bar_html->ad_conn parameter::get parameter::get (public) ad_context_bar_html->parameter::get ad_context_bar ad_context_bar (public) ad_context_bar->ad_context_bar_html

Testcases:
ad_context_bar_html
Source code:
 
 
    if {![info exists ::ad_conn(subsite_id)]} {
       # the following call would crash; for some reason, we do not have determined the subsite id; maybe, the request was utterly incorrect.
       ns_log Warning "Cannot determine subsite for request: [ns_conn request]\nHeaders:\n[ns_set array [ns_conn headers]]"
       return ""
    }
    
    # Get the separator from subsite parameter
    if { ![info exists separator] } {
        set subsite_id [ad_conn subsite_id]
        set separator [parameter::get -package_id $subsite_id -parameter ContextBarSeparator -default ":"]
    }

    set out {}
    llength $context
    foreach element [lrange $context 0 [llength $context]-2] {
        lassign $element href label
        append out [subst {<a href="[ns_quotehtml $href]">[ns_quotehtml $label]</a> $separator }]
    }
    append out [ns_quotehtml [lindex $context end]]

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