Index: openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl,v diff -u -r1.57.2.21 -r1.57.2.22 --- openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 16 Mar 2021 22:09:49 -0000 1.57.2.21 +++ openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 29 Mar 2021 08:34:19 -0000 1.57.2.22 @@ -106,6 +106,28 @@ return [expr {int(($length-1) * rand())}] } + ad_proc filter_option_list {option_list except} { + + Process an option list (pairs of label and id) + suitable to be passed to several widgets and remove + all entries having an id from the except list. + + @param option_list list of labels and ids + @param except list of interal ids + @return filtered option list + } { + if {[llength $except] == 0} { + return $option_list + } + return [lmap tuple $option_list { + if {[lindex $tuple 1] in $except} { + continue + } + set _ $tuple + }] + } + + # # # Helper for virus checks