diff --git a/web/web_arg_utils.anubis b/web/web_arg_utils.anubis index be6afed..8f351dc 100644 --- a/web/web_arg_utils.anubis +++ b/web/web_arg_utils.anubis @@ -360,6 +360,26 @@ public define Maybe(Bool) // println("value = '"+value+"' result = "+to_String(return_v)+" success("+to_String(return_v)+")"); success(return_v) }. + +public define Maybe(Bool) + get_tristate + ( + List(Web_arg) lwa, + String arg_name + ) = +// println("get_mb_Bool "+arg_name); + if web_arg_value(lwa, arg_name) is + { + not_found then failure + found(value) then + if value = "checked" then success(true) + else if value = "unchecked" then success(false) + else if value = "intermediate" then failure + else failure, +// println("value = '"+value+"' result = "+to_String(return_v)+" success("+to_String(return_v)+")"); + + } +. public define Bool get_Bool -- libgit2 0.21.4