wp_slider

one of the documented procedures in this installation of the ACS
Usage:
wp_slider   which   current   items
What it does:
Generates a slider for form variable $which with items $items, of the form { { 1 "One" } { 2 "Two" } }, where 1/2 are the query values and One/Two are the corresponding labels.
Defined in: /web/philip/tcl/wp-defs.tcl

Source code:


    set choices ""

    regexp {/([^/]*)$} [ns_conn url] "" dest_url
    if { $dest_url == "" } {
	set dest_url "index.tcl"
    }

    foreach i $items {
	set newval [lindex $i 0]
	set label [lindex $i 1]

	if { $current != $newval } {
	    # Not currently selected - generate the link.
	    lappend choices "<a href=\"$dest_url?[ export_ns_set_vars "url" $which ]&$which=$newval\">$label</a>"
	} else {
	    # Currently selected.
	    lappend choices "<b>$label</b>"
	}
    }

    return "\[ [join $choices " | "] \]"


philg@mit.edu