left_menu.anubis
7.88 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
/*
* Created by PyramIDE.
* User: フランスのトトロ
* Date: 10/01/2016
* Time: 12:24
* © David RENÉ
*/
transmit tools/basis.anubis
read xlib/web/CXM_web_action.anubis
read xlib/web/CXM_web_action.anubis
read system/string.anubis
public type Left_Menu_Entry:
left_menu_entry( //MENU entry hence no selectable
String entry_id, //it's also use as icon prefix
Bool sub_entry,
List(String) classes, //additional classes if need (for disabling entry, change background color, etc.)
WEB_Action_Name action, //action (url to apply when click
String text, //text to show
List((String, String)) extra, //extra web arguments to send when click
Maybe(String) target_id //target_id use during load_content
),
title( //TITLE entry hence no selectable
String title_id, //it's also use as icon prefix
Bool subtitle,
List(String) classes, //additional classes if need (change background color, font size, etc.)
String text //text to show
)
.
public type Left_Menu:
no_left_menu,
left_menu(
List(Left_Menu_Entry) entries,
String selected
)
.
public type Plugin_Left_Menu:
plugin_left_menu(
String app, //application name
String space, //space name
Left_Menu left_menu
)
.
public type Space_Left_Menu:
space_menu(
String name,
Left_Menu menu
)
.
public type App_Left_Menu:
app_menu(
String name,
List(Space_Left_Menu) space_menu_list
)
.
public type World_Left_Menu:
world_menu(
List(App_Left_Menu) app_menu_list
)
.
public define List(Space_Left_Menu)
add_to_space
(
List(Space_Left_Menu) space_list,
List(Space_Left_Menu) so_far,
String space_name,
Left_Menu left_menu
)=
if space_list is
{
[] then [space_menu(space_name, left_menu)],
[h . t] then
if h.name = space_name then // if we found the same name we replace it into the list
[space_menu(space_name, left_menu) . so_far]+t
else
add_to_space(t, [h . so_far], space_name, left_menu)
}
.
public define World_Left_Menu
add_to_app
(
List(App_Left_Menu) app_list,
List(App_Left_Menu) so_far,
String app_name,
String space_name,
Left_Menu left_menu
)=
if app_list is
{
[] then world_menu([app_menu(app_name, [space_menu(space_name, left_menu)]) . so_far]),
[h . t] then
if h.name = app_name then
world_menu([app_menu(app_name, add_to_space(h.space_menu_list, [], space_name, left_menu)) . so_far]+t)
else
add_to_app(t, [h . so_far], app_name, space_name, left_menu)
}
.
public define World_Left_Menu
add_to_World_Left_Menu
(
World_Left_Menu w_left_menu,
Plugin_Left_Menu p_left_menu
)=
since p_left_menu is plugin_left_menu(app, space, l_menu),
add_to_app(w_left_menu.app_menu_list, [], app, space, l_menu)
.
public define World_Left_Menu
add_to_World_Left_Menu
(
World_Left_Menu current_world,
List(Plugin_Left_Menu) p_left_menu
)=
if p_left_menu is
{
[] then current_world,
[h . t] then add_to_World_Left_Menu(add_to_World_Left_Menu(current_world, h), t)
}
.
public define World_Left_Menu
add_to_World_Left_Menu
(
List(Plugin_Left_Menu) p_left_menu
)=
add_to_World_Left_Menu(world_menu([]), p_left_menu)
.
public define Left_Menu_Entry
left_menu_entry
(
String entry_id,
WEB_Action_Name action,
String text
)=
left_menu_entry(entry_id, false, [], action, text, [], failure)
.
public define Left_Menu_Entry
left_menu_sub_entry
(
String entry_id,
WEB_Action_Name action,
String text
)=
left_menu_entry(entry_id, true, [], action, text, [], failure)
.
public define Left_Menu_Entry
left_menu_entry
(
String entry_id,
String action,
String text
)=
left_menu_entry(entry_id, false, [], action_name(action), text, [], failure)
.
public define Left_Menu_Entry
left_menu_sub_entry
(
String entry_id,
String action,
String text
)=
left_menu_entry(entry_id, true, [], action_name(action), text, [], failure)
.
public define Left_Menu_Entry
left_menu_entry
(
String entry_id, //it's also use as icon prefix
WEB_Action_Name action, //action (url to apply when click
String text, //text to show
List((String, String)) extra //extra web arguments to send when click
)=
left_menu_entry(entry_id, false, [], action, text, extra, failure)
.
public define Left_Menu_Entry
left_menu_sub_entry
(
String entry_id, //it's also use as icon prefix
WEB_Action_Name action, //action (url to apply when click
String text, //text to show
List((String, String)) extra //extra web arguments to send when click
)=
left_menu_entry(entry_id, true, [], action, text, extra, failure)
.
public define Left_Menu_Entry
left_menu_entry
(
String entry_id, //it's also use as icon prefix
WEB_Action_Name action, //action (url to apply when click
String text, //text to show
List((String, String)) extra, //extra web arguments to send when click
String target_id
)=
left_menu_entry(entry_id, false, [], action, text, extra, success(target_id))
.
public define Left_Menu_Entry
left_menu_sub_entry
(
String entry_id, //it's also use as icon prefix
WEB_Action_Name action, //action (url to apply when click
String text, //text to show
List((String, String)) extra, //extra web arguments to send when click
String target_id
)=
left_menu_entry(entry_id, true, [], action, text, extra, success(target_id))
.
public define Left_Menu_Entry
left_menu_entry
(
String entry_id, //it's also use as icon prefix
String action, //action (url to apply when click
String text, //text to show
List((String, String)) extra //extra web arguments to send when click
)=
left_menu_entry(entry_id, false, [], action_name(action), text, extra, failure)
.
public define Left_Menu_Entry
left_menu_sub_entry
(
String entry_id, //it's also use as icon prefix
String action, //action (url to apply when click
String text, //text to show
List((String, String)) extra //extra web arguments to send when click
)=
left_menu_entry(entry_id, true, [], action_name(action), text, extra, failure)
.
public define Left_Menu_Entry
left_menu_entry
(
String entry_id, //it's also use as icon prefix
String action, //action (url to apply when click
String text, //text to show
List((String, String)) extra, //extra web arguments to send when click
String target_id
)=
left_menu_entry(entry_id, false, [], action_name(action), text, extra, success(target_id))
.
public define Left_Menu_Entry
left_menu_sub_entry
(
String entry_id, //it's also use as icon prefix
String action, //action (url to apply when click
String text, //text to show
List((String, String)) extra, //extra web arguments to send when click
String target_id
)=
left_menu_entry(entry_id, true, [], action_name(action), text, extra, success(target_id))
.
public define Left_Menu_Entry
title
(
String text
)=
title("", false, [], text).
public define Left_Menu_Entry
subtitle
(
String text
)=
title("", true, [], text).
public define Left_Menu_Entry
title
(
String title_id,
String text
)=
title(title_id, false, [], text)
.
public define Left_Menu_Entry
subtitle
(
String title_id,
String text
)=
title(title_id, true, [], text)
.