left_menu.anubis
1.89 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
/*
* Created by PyramIDE.
* User: フランスのトトロ
* Date: 10/01/2016
* Time: 12:24
* © Calexium
*/
transmit tools/basis.anubis
read calexium_lib/web/CXM_making_a_web_site.anubis
public type Left_Menu_Entry:
left_menu_entry(
String class,
String action,
String text,
List((String, String)) extra),
title(String class, String text).
public type Left_Menu:
no_left_menu,
left_menu(
List(Left_Menu_Entry) entries,
String selected).
public define Left_Menu_Entry
left_menu_entry
(
String class,
String action,
String text
)=
left_menu_entry(class, action, text, [])
.
define List(HTML_Off_Form)
make_left_menu
(
(String) -> String _T, //translator function
List(Left_Menu_Entry) entries,
String selected,
List(HTML_Off_Form) so_far
)=
if entries is
{
[] then reverse(so_far), //reverse to be in the right direction
[h . t] then
with entry =
if h is
{
left_menu_entry(_class, _action, _text, _extra) then
(HTML_Off_Form)paragraph([class("item "+_class+"_icon"+if _class=selected then " selected" else "")],actioner(same,same, link(_T(_text)),_action,_extra)),
title(_class, _text) then
(HTML_Off_Form)paragraph([class("menu_title"), class("item "+_class+"_icon"+if _class=selected then " selected" else "")], text([],_T(_text)))
},
make_left_menu(_T, t, selected, [ entry . so_far])
}.
public define HTML_Partial_Content
make_left_menu
(
(String) -> String _T, //translator function
Left_Menu l_menu
)=
if l_menu is
{
no_left_menu then partial_content(empty),
left_menu(entries, selected) then
partial_content([css(css_file("/css/left_menu.css"))],
sequence(make_left_menu(_T, entries, selected, [])))
}.