Index: openacs-4/packages/xotcl-core/tcl/context-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/context-procs.tcl,v diff -u -r1.53 -r1.54 --- openacs-4/packages/xotcl-core/tcl/context-procs.tcl 1 Jun 2010 08:43:20 -0000 1.53 +++ openacs-4/packages/xotcl-core/tcl/context-procs.tcl 18 Jun 2010 10:26:59 -0000 1.54 @@ -508,8 +508,10 @@ proc ::xo::update_query_variable {old_query var value} { # - # replace in a url-query old occurances of var with new value. + # Replace in a url-query old occurances of var with new value. # + # @return pairs in a form suitable for export_vars + # set query [list [list $var $value]] foreach pair [split $old_query &] { foreach {key value} [split $pair =] break @@ -519,4 +521,19 @@ return $query } + proc ::xo::update_query {old_query var value} { + # + # Replace in a url-query old occurances of var with new value. + # + # @return encoded HTTP query + # + set query [ns_urlencode $var]=[ns_urlencode $value] + foreach pair [split $old_query &] { + foreach {key value} [split $pair =] break + if {$key eq $var} continue + append query &$pair + } + return $query + } + } \ No newline at end of file