Index: openacs-4/packages/logger/tcl/ui-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/logger/tcl/ui-procs.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/logger/tcl/ui-procs.tcl 22 Apr 2003 09:25:40 -0000 1.1
+++ openacs-4/packages/logger/tcl/ui-procs.tcl 1 May 2003 07:19:41 -0000 1.2
@@ -11,7 +11,8 @@
namespace eval logger::ui {}
ad_proc -public logger::ui::navbar_link_selected_p {
- navbar_url
+ navbar_url
+ param_list
} {
Return 1 if the navbar link with given URL (relative server URL) should be marked
@@ -20,7 +21,7 @@
A link is considered selected if the current page url starts with the url of the link
- followed by the optional slash, question mark and query string
+ and each HTML parameter in the param_list has the specified value.
@author Peter Marklund
@@ -33,7 +34,31 @@
regsub {} $selected_pattern $url_no_slash selected_pattern
set page_url [ad_conn url]
- set selected_p [regexp $selected_pattern $page_url match]
+ set url_matches_p [regexp $selected_pattern $page_url match]
+ set params_match_p 1
+ foreach {param_item} $param_list {
+ set param_name [lindex $param_item 0]
+ set param_value [lindex $param_item 1]
+
+ set actual_param_value [ns_set iget [rp_getform] $param_name]
+
+ ns_log Notice "pm debug param_name $param_name param_value $param_value actual_param_value $actual_param_value"
+ if { ![string equal $param_value $actual_param_value] } {
+ set params_match_p 0
+ break
+ }
+ }
+
+ if { [llength $param_list] == 0 && ![empty_string_p [ad_conn query]] } {
+ # The navbar link has no url parameters but there url parameters in the
+ # request. Don't consider the link selected
+ set params_match_p 0
+ }
+
+ set selected_p [expr $url_matches_p && $params_match_p]
+
+ ns_log Notice "pm debug url_no_slash $url_no_slash page_url $page_url selected_p $selected_p"
+
return $selected_p
}