summaryrefslogtreecommitdiff
path: root/htc/dmled.htc
diff options
context:
space:
mode:
Diffstat (limited to 'htc/dmled.htc')
-rw-r--r--htc/dmled.htc128
1 files changed, 128 insertions, 0 deletions
diff --git a/htc/dmled.htc b/htc/dmled.htc
new file mode 100644
index 0000000..61929fa
--- /dev/null
+++ b/htc/dmled.htc
@@ -0,0 +1,128 @@
1\include{dml.htc}
2\def{dmled.init}{xx}{
3 %{listname}{address}
4 \dml.init{\1}{\group}{\npwd}{\server\npwd};
5 \reconst{dml.address}{\2};
6 \sort{DML}{INDEX}{>}
7}
8\def{dmled.page}{}{
9 \cond{T.find}{}
10 \cond{T.msg}{0}
11 \title{Database Mailing List (\dml.listname)}
12 \db{DML}{
13 \form{
14 \table{width=100% bgcolor=#dddddd}{
15 \tr{valign=top}{
16 \td{
17 <select name=dummy size=6>
18 [tf:=\T.find];
19 \query(
20 (tf eq "" ||SUBJECT cntn tf||AUTHOR cntn tf||BODY cntn tf)&&
21 (!PROTECT||\user.allow(\dml.group)(TIME))
22 ){
23 \option{\if(INDEX==\T.msg){ selected }}(INDEX){
24 [INDEX] - \sub(SUBJECT){0}{30}
25 \su(AUTHOR){\[\user.name\]}; (\time2htc(TIME))
26 \if(count ATTACH){\[attach\]}
27 }
28 }
29 </select>
30 }
31 \td{
32 \button{View}<br>
33 \button{Reply}<br>
34 \button{New}
35 }
36 }
37 \tr{valign=top}{
38 \td{
39 \input{find}{60}{\T.find}
40 }
41 \td{
42 \button{Search}
43 }
44 }
45 }
46 }
47 \find.rec{\T.msg}{
48 \if(!PROTECT||\user.allow(\dml.group)(TIME)){
49 \table{width=100% bgcolor=#dddddd}{
50 \tr{
51 \th{align=left}{[INDEX] - [SUBJECT]}
52 \td{align=right}{
53 \find.rec(PARENT){
54 \if(!PROTECT||\user.allow(\dml.group)(TIME)){
55 \bf{Prev:}
56 \href{\this?msg=[INDEX]}{[INDEX] - \sub(SUBJECT){0}{30}}
57 \su(AUTHOR){\[\user.name\]}
58 }
59 }
60 }
61 }
62 \tr{
63 \td{align=left}{
64 \su(AUTHOR){
65 \user.name \lt;\href{mailto:\user.email}{\user.email};\gt
66 }
67 }
68 \td{align=right}{
69 \time2htc(TIME)
70 }
71 }
72 \tr{
73 \td{align=left colspan=2}{
74 \htmlize(BODY)
75 }
76 }
77 \if(count ATTACH){
78 \tr{
79 \td{align=left colspan=2}{
80 \forall{i}(ATTACH){
81 \href{\npwd/attach/[i]}(i)\n
82 }
83 }
84 }
85 }
86 \tr{
87 \td{align=left colspan=2}{
88 [idx:=INDEX];
89 \query(PARENT==idx&&(!PROTECT||\user.allow(\dml.group)(TIME))){
90 \bf{Next:}
91 \href{\this?msg=[INDEX]}{[INDEX] - [SUBJECT]}
92 \su(AUTHOR){\[\user.name\]}
93 <br>
94 }
95 }
96 }
97 }
98 }
99 }
100 }
101}
102\def{dmled.onpost}{}{
103 \switch{\T.cmd}
104 {View}{
105 \redirect{\server\this?msg=\T.dummy}
106 }
107 {Reply}{
108 \redirect{\server\this}
109 \db{DML}{
110 \find.rec{\T.dummy}{
111 \if(!PROTECT||\user.allow(\dml.group)(TIME)){
112 \redirect{
113 mailto:\dml.address?subject=Reply \dml.listname\[[INDEX]\] [SUBJECT]
114 }
115 }
116 }
117 }
118 }
119 {New}{
120 [node:=\on.glob{T.dummy}{\T.dummy}{1}];
121 \redirect{mailto:\dml.address?subject=New \dml.listname\[[node]\] (no subject)}
122 }
123 {
124 \on.glob{T.find}{
125 \redirect{\server\this?find=\encode{\T.find}}
126 }
127 }
128}