Commit cd578a4491fed20d04535920f1dad4794d08acb8
1 parent
28ee8132
Add the get_Bool with default value
Showing
1 changed file
with
17 additions
and
4 deletions
Show diff stats
web/CXM_web_arg_utils.anubis
| ... | ... | @@ -3,11 +3,11 @@ |
| 3 | 3 | * User: Totoro |
| 4 | 4 | * Date: 07/02/2014 |
| 5 | 5 | * Time: 21:43 |
| 6 | - * | |
| 7 | 6 | */ |
| 8 | -read tools/basis.anubis | |
| 9 | -read calexium_lib/web/CXM_common.anubis | |
| 10 | -read calexium_lib/database/db_types.anubis | |
| 7 | + | |
| 8 | +transmit tools/basis.anubis | |
| 9 | +transmit calexium_lib/web/CXM_common.anubis | |
| 10 | +transmit calexium_lib/database/db_types.anubis | |
| 11 | 11 | |
| 12 | 12 | public define DB_id |
| 13 | 13 | get_DB_id |
| ... | ... | @@ -103,6 +103,19 @@ public define Bool |
| 103 | 103 | found(_) then true |
| 104 | 104 | }. |
| 105 | 105 | |
| 106 | +public define Bool | |
| 107 | + get_Bool | |
| 108 | + ( | |
| 109 | + List(Web_arg) lwa, | |
| 110 | + String arg_name, | |
| 111 | + Bool default_value | |
| 112 | + ) = | |
| 113 | + if web_arg_value(lwa, arg_name) is | |
| 114 | + { | |
| 115 | + not_found then default_value, | |
| 116 | + found(_) then true | |
| 117 | + }. | |
| 118 | + | |
| 106 | 119 | public define Maybe(Bool) |
| 107 | 120 | get_Bool |
| 108 | 121 | ( | ... | ... |