CXM_web_action.anubis
2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
* Created by PyramIDE.
* User: フランスのトトロ aka (David RENÉ)
* Date: 14/03/2017
* Time: 04:23
* © David RENÉ
*/
read system/string.anubis
transmit xlib/web/types/web_action_name.anubis
transmit xlib/web/CXM_urllib.anubis
public define String
format_extra_operands
(
List((String,String)) l_args
) =
if length(l_args) = 0 then
""
else
"&"+join("&", map(((String, String) arg) |-> since arg is (name, value), name+"="+url_quote(value), l_args))
.
public define String
to_Anubis_Source
(
WEB_Action_Name wan
)=
if wan is
{
no_action then "no_action",
controller_action(cont, ac_name) then "controller_action(\""+cont+"\", \""+ac_name+"\")",
action_name(ac_name) then "action_name(\""+ac_name+"\")",
url(url_name) then "url(\""+url_name+"\")"
}
.
public define String
format_web_action_name
(
WEB_Action_Name action
)=
if action is
{
no_action then "",
controller_action(controller, action_name) then "?aws_c="+controller+"&aws_a="+action_name,
action_name(action_name) then "?aws_action="+action_name,
url(url) then url
}
.
public define String
format_web_action_name
(
WEB_Action_Name action,
List((String,String)) extra_ops
)=
format_web_action_name(action)
+
format_extra_operands(extra_ops)
.
public define String
format_web_action_name
(
WEB_Action_Name action,
(String,String) extra_ops
)=
format_web_action_name(action)
+
format_extra_operands([extra_ops])
.
public define String
format_web_action_name_to_js
(
WEB_Action_Name action,
List((String,String)) extra_ops,
)=
"'"+format_web_action_name(action, extra_ops)+"'"
.
public define String
format_web_action_name_to_js
(
WEB_Action_Name action,
(String,String) extra_ops,
)=
"'"+format_web_action_name(action, extra_ops)+"'"
.
public define String
format_web_action_name_to_js
(
WEB_Action_Name action
)=
format_web_action_name_to_js(action, [])
.