Index: openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl,v diff -u -r1.42 -r1.43 --- openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl 15 Jun 2018 22:10:30 -0000 1.42 +++ openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl 15 Jun 2018 22:12:48 -0000 1.43 @@ -3,35 +3,35 @@ @cvs-id $Id$ @author philg@mit.edu - @creation-date 11/5/98 (adapted originally from the Cognet server) + @creation-date 11/5/98 (adapted originally from the Cognet server) } -# edited February 28, 1999 by philg to include support for a +# edited February 28, 1999 by philg to include support for a # Yahoo-style navigation system (showing users where they are in a # hierarchy) ad_proc -public ad_context_bar_html { -separator context -} { +} { 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"] + [list [list url1 text1] [list url2 text2] ... "terminal text"]- and generates the html fragment. In general the higher level + 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 + used, and then only in the sitewide master rather than on individual pages. @param separator The text placed between each link - @param context list as with ad_context_bar - + @param context list as with ad_context_bar + @return html fragment @see ad_context_bar -} { - +} { + # Get the separator from subsite parameter if { ![info exists separator] } { set subsite_id [ad_conn subsite_id] @@ -55,21 +55,21 @@ Starting with the given node_id, return a list of [list url instance_name] items for parent nodes. - @option from_node The top-most node_id for which we'll show context bar. This can be used with + @option from_node The top-most node_id for which we'll show context bar. This can be used with the node_id of the nearest subsite to get the context-bar only up to the nearest subsite. @author Peter Marklund } { set context [list] - while { $node_id ne "" } { + while { $node_id ne "" } { array set node [site_node::get -node_id $node_id] # JCD: Provide something for the name if the instance name is # absent. name is the tail bit of the url which seems like a # reasonable thing to display. if {$node(instance_name) eq "" - && [info exists node(name)]} { + && [info exists node(name)]} { set node(instance_name) $node(name) } @@ -90,7 +90,7 @@ return $context } -ad_proc -public ad_context_bar_multirow { +ad_proc -public ad_context_bar_multirow { {-from_node ""} {-node_id ""} {-multirow "context"} @@ -104,25 +104,25 @@ @param from_node If provided do not generate links to the given node and above. @param separator The text placed between each link (passed to ad_context_bar_html if provided) @return an html fragment generated by ad_context_bar_html - + @see ad_context_bar_html } { if {![parameter::get -package_id [ad_conn subsite_id] -parameter ShowContextBarP -default 1]} { return "" } - + if { $node_id eq "" } { set node_id [ad_conn node_id] } set temp_node_id [util_current_location_node_id] if { $temp_node_id eq "" } { - # not a site host_node + # not a site host_node set node_id_url "" set node_id_url_end 0 } else { set from_node $temp_node_id - set node_id_url [site_node::get_url -node_id ${temp_node_id} -notrailing] + set node_id_url [site_node::get_url -node_id ${temp_node_id} -notrailing] set node_id_url_end [string length $node_id_url] } @@ -135,12 +135,12 @@ } template::multirow append $multirow $elm_0 $elm_1 } - + if { [string match "admin/*" [ad_conn extra_url]] } { template::multirow append $multirow "[ad_conn package_url]admin/" "[_ acs-tcl.Administration]" } - - if { [llength $context] == 0 } { + + if { [llength $context] == 0 } { # fix last element to just be literal string template::multirow set $multirow [template::multirow size $multirow] url {} } else { @@ -151,7 +151,7 @@ } } -ad_proc -public ad_context_bar { +ad_proc -public ad_context_bar { {-from_node ""} {-node_id ""} -separator @@ -165,7 +165,7 @@ @param from_node If provided do not generate links to the given node and above. @param separator The text placed between each link (passed to ad_context_bar_html if provided) @return an html fragment generated by ad_context_bar_html - + @see ad_context_bar_html } { if {![parameter::get -package_id [ad_conn subsite_id] -parameter ShowContextBarP -default 1]} { @@ -183,14 +183,14 @@ [_ acs-tcl.Administration]] } - if {[llength $args] == 0} { + if {[llength $args] == 0} { # fix last element to just be literal string lset context end [lindex $context end 1] } else { if {![string match "\{*" $args]} { # args is not a list, transform it into one. set args [list $args] - } + } } lappend context {*}$args if { [info exists separator] } { @@ -230,7 +230,7 @@ ad_proc -public ad_choice_bar { items links values {default ""} } { Displays a list of choices (Yahoo style), with the currently selected one highlighted. - @see ad_navbar + @see ad_navbar } { set count 0 @@ -251,7 +251,7 @@ } else { return "" } - + } ad_proc -public util_current_location_node_id { } { @@ -261,7 +261,7 @@ if { [string match -nocase "www.*" $location_hostname] } { set location_hostname [string range $location_hostname 4 end] - } + } db_0or1row -cache_key util-${location_hostname}-node-id get_node_id_from_hostname { select node_id from host_node_map where host = :location_hostname } @@ -283,13 +283,13 @@ # determines if java_script should be enabled - + proc java_script_capabilities {} { set user_agent "" set version 0 set internet_explorer_p 0 set netscape_p 0 - + # get the version set user_agent [ns_set get [ad_conn headers] User-Agent] regexp -nocase "mozilla/(\[^\.\ \]*)" $user_agent match version @@ -301,9 +301,9 @@ if {$internet_explorer_p == 0} { set netscape_p [regexp -nocase "mozilla" $user_agent match] } - + set java_script_p 0 - + if { ($netscape_p && ($version >= 3)) || ($internet_explorer_p && ($version >= 4)) } { set java_script_p 1 } @@ -318,21 +318,21 @@ set version 0 set internet_explorer_p 0 set netscape_p 0 - + # get the version set user_agent [ns_set get [ad_conn headers] User-Agent] regexp -nocase "mozilla/(\[^\.\ \]*)" $user_agent match version - + # IE browsers have MSIE and Mozilla in their user-agent header set internet_explorer_p [regexp -nocase "msie" $user_agent match] - + # Netscape browser just have Mozilla in their user-agent header if {$internet_explorer_p == 0} { set netscape_p [regexp -nocase "mozilla" $user_agent match] } - + set netscape3_p 0 - + if { ($netscape_p && ($version == 3))} { set netscape3_p 1 } @@ -372,7 +372,7 @@ } incr counter } - + append return_string "
@@ -387,14 +387,14 @@ # -- # this incorporates HTML designed by Ben (not adida, some other guy) # proc ad_menu_header {{section ""} {uplink ""}} { - + # set section [string tolower $section] # # if it is an excluded directory, just return # set url_stub [ad_conn url] # set full_filename "$::acs::pageroot$url_stub" - + # foreach naked_pattern [ad_naked_html_patterns] { # if { [string match $naked_pattern $url_stub] } { # # want the global admins with no menu, but not the domain admin @@ -405,29 +405,29 @@ # # title is the title for the title bar # # section is the highlight for the menu - -# set menu_items [menu_items] + +# set menu_items [menu_items] # set java_script_p [java_script_capabilities] - + # # Ben has a different table structure for netscape 3 # set netscape3_p [netscape3_browser] # set return_string "" # if { $java_script_p } { -# append return_string " +# append return_string " # " +# " # } else { - + # append return_string " # " -# } +# } # # We divide up the screen into 4 areas top to bottom: # # + The top table which is the cognet logo and search stuff. # # + The next table down is the CogNet name and area name. # # + The next area is either 1 large table with 2 sub-tables, or two tables (NS 3.0). # # The left table is the navigation table and the right one is the content. # # + Finally, the bottom table holds the bottom navigation bar. - + # append return_string "[ad_body_tag]" - - + + # if {$netscape3_p} { -# append return_string " +# append return_string " #
Search |