From cd578a4491fed20d04535920f1dad4794d08acb8 Mon Sep 17 00:00:00 2001 From: totoro Date: Mon, 18 Jan 2016 10:48:28 +0100 Subject: [PATCH] Add the get_Bool with default value --- web/CXM_web_arg_utils.anubis | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/web/CXM_web_arg_utils.anubis b/web/CXM_web_arg_utils.anubis index 5cc0b08..b6e7f25 100644 --- a/web/CXM_web_arg_utils.anubis +++ b/web/CXM_web_arg_utils.anubis @@ -3,11 +3,11 @@ * User: Totoro * Date: 07/02/2014 * Time: 21:43 - * */ -read tools/basis.anubis -read calexium_lib/web/CXM_common.anubis -read calexium_lib/database/db_types.anubis + +transmit tools/basis.anubis +transmit calexium_lib/web/CXM_common.anubis +transmit calexium_lib/database/db_types.anubis public define DB_id get_DB_id @@ -103,6 +103,19 @@ public define Bool found(_) then true }. +public define Bool + get_Bool + ( + List(Web_arg) lwa, + String arg_name, + Bool default_value + ) = + if web_arg_value(lwa, arg_name) is + { + not_found then default_value, + found(_) then true + }. + public define Maybe(Bool) get_Bool ( -- libgit2 0.21.4