* Added "add/edit room graphic" screens.
[citadel.git] / webcit / mainmenu.c
1 /* $Id$ */
2
3 #include <stdlib.h>
4 #ifdef HAVE_UNISTD_H
5 #include <unistd.h>
6 #endif
7 #include <stdio.h>
8 #include <ctype.h>
9 #include <string.h>
10 #include <errno.h>
11 #include "webcit.h"
12 #include "child.h"
13
14
15 /* 
16  * menu of commands (just the menu html itself)
17  */
18
19 void embed_main_menu(void) {
20         wprintf("<CENTER><TABLE border=0><TR>");
21
22         wprintf("<TD>");        /* start of first column */
23
24         wprintf("<UL>");
25         wprintf("<LI><B><A HREF=\"/knrooms\">\n");
26         wprintf("List known rooms</B></A><BR>\n");
27         wprintf("Where can I go from here?</LI>\n");
28         
29         wprintf("<LI><B><A HREF=\"/gotonext\" TARGET=\"top\">\n");
30         wprintf("Goto next room</B></A><BR>\n");
31         wprintf("...with <EM>unread</EM> messages</LI>\n");
32         
33         wprintf("<LI><B><A HREF=\"/skip\" TARGET=\"top\">\n");
34         wprintf("Skip to next room</B></A><BR>\n");
35         wprintf("(come back here later)</LI>\n");
36         
37         if ( (strlen(ugname)>0) && (strcasecmp(ugname,wc_roomname)) ) {
38                 wprintf("<LI><B><A HREF=\"/ungoto\" TARGET=\"top\">\n");
39                 wprintf("Ungoto</B></A><BR>\n");
40                 wprintf("(oops! Back to %s)</LI>\n",ugname);
41                 }
42         
43         wprintf("</UL>\n");
44         
45         wprintf("</TD><TD>\n"); /* start of second column */
46         
47         wprintf("<UL>");
48         wprintf("<LI><B><A HREF=\"/readnew\">\n");
49         wprintf("Read new messages</B></A><BR>...in this room</LI>\n");
50         
51         wprintf("<LI><B><A HREF=\"/readfwd\">\n");
52         wprintf("Read all messages</B></A><BR>...old <EM>and</EM> new</LI>\n");
53
54         wprintf("<LI><B><A HREF=\"/display_enter\">\n");
55         wprintf("Enter a message</B></A><BR>(post in this room)</LI>");
56         wprintf("</UL>\n");
57
58         wprintf("</TD><TD>"); /* start of third column */
59
60         wprintf("<UL>");
61         wprintf("<LI><B><A HREF=\"/whobbs\">\n");
62         wprintf("Who is online?</B></A><BR>(users <EM>currently</EM> logged on)</LI>\n");
63         
64         wprintf("<LI><B><A HREF=\"/userlist\">\n");
65         wprintf("User list</B></A><BR>(all registered users)</LI>\n");
66
67         wprintf("<LI><B><A HREF=\"/advanced\">\n");
68         wprintf("Advanced options</B></A><BR>...and maintenance</LI>\n");
69
70         wprintf("<LI><B><A HREF=\"/termquit\" TARGET=\"_top\">\n");
71         wprintf("Log off</B></A><BR>Bye!</LI>\n");
72         wprintf("</UL>\n");
73
74         wprintf("</TR></TABLE>\n");
75
76         wprintf("</CENTER>\n");
77         }
78
79 /*
80  * advanced options
81  */
82 void embed_advanced_menu(void) {
83
84 wprintf("<TABLE WIDTH=100%><TR VALIGN=TOP><TD>");
85
86
87 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
88 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
89 wprintf("<B>Interaction</B>\n");
90 wprintf("</FONT></TD></TR></TABLE>\n");
91
92 wprintf("<UL>");
93 wprintf("<LI><A HREF=\"/display_page\">\n");
94 wprintf("Page another user</A>\n");
95
96 wprintf("<LI><A HREF=\"/chat\">");
97 wprintf("Chat with other online users</A>\n");
98
99 wprintf("</UL>\n");
100
101 wprintf("</TD><TD>");
102
103 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
104 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
105 wprintf("<B>Your info</B>\n");
106 wprintf("</FONT></TD></TR></TABLE>\n");
107
108 wprintf("<UL>");
109 wprintf("<LI><A HREF=\"/display_editbio\">\n");
110 wprintf("Enter your 'bio' (a few words about yourself)</A>\n");
111
112 wprintf("<LI><A HREF=\"/display_editpic\">\n");
113 wprintf("Edit your online photo</A>\n");
114
115 wprintf("<LI><A HREF=\"/display_reg\">\n");
116 wprintf("Re-enter your registration info (name, address, etc.)</A>\n");
117
118 wprintf("<LI><A HREF=\"/display_changepw\">\n");
119 wprintf("Change your password</A>\n");
120
121 wprintf("</UL>\n");
122
123
124 wprintf("</TD></TR><TR VALIGN=TOP><TD>");
125
126 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
127 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
128 wprintf("<B>Advanced room commands</B>\n");
129 wprintf("</FONT></TD></TR></TABLE>\n");
130
131 wprintf("<UL>");
132 wprintf("<LI><A HREF=\"/display_private\">\n");
133 wprintf("Go to a 'hidden' room</A>\n");
134
135 wprintf("<LI><A HREF=\"/display_entroom\">");
136 wprintf("Create a new room</A>\n");
137
138 wprintf("<LI><A HREF=\"/display_zap\">");
139 wprintf("Zap (forget) this room (%s)</A>\n", wc_roomname);
140
141 wprintf("<LI><A HREF=\"/zapped_list\">");
142 wprintf("List all forgotten rooms</A>\n");
143
144 wprintf("</UL>\n");
145
146 wprintf("</TD><TD>");
147
148 if ((axlevel>=6) || (is_room_aide)) {
149         wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007777><TR><TD>");
150         wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
151         wprintf("<B>Administrative functions</B>\n");
152         wprintf("</FONT></TD></TR></TABLE>\n");
153
154         wprintf("<UL>");
155         wprintf("<LI><A HREF=\"/display_editroom\">\n");
156         wprintf("Edit this room</A>\n");
157         
158         wprintf("<LI><A HREF=\"/confirm_delete_room\">\n");
159         wprintf("Delete this room</A>\n");
160         
161         wprintf("<LI><A HREF=\"/display_editroompic\">\n");
162         wprintf("Set or change the graphic for this room's banner</A>\n");
163
164         wprintf("<LI><A HREF=\"/display_editinfo\">\n");
165         wprintf("Edit this room's Info file</A>\n");
166
167         if (axlevel>=6) {
168                 wprintf("<LI><A HREF=\"/validate\">\n");
169                 wprintf("Validate new users</A>\n");
170
171                 wprintf("<LI><A HREF=\"/select_floor_to_edit_pic\">\n");
172                 wprintf("Set or change a floor label graphic</A>\n");
173
174                 wprintf("<LI><A HREF=\"/display_netconf\">\n");
175                 wprintf("Configure networking with other systems</A>\n");
176                 }
177
178         wprintf("</UL>\n");
179         }
180
181 wprintf("</TD></TR></TABLE>");
182
183 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770077><TR><TD>");
184 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
185 wprintf("<B>Basic commands</B>\n");
186 wprintf("</FONT></TD></TR></TABLE>\n");
187
188         }
189
190
191
192
193 /*
194  * menu of commands (as a page)
195  */
196 void display_main_menu(void) {
197         printf("HTTP/1.0 200 OK\n");
198         output_headers(1);
199         embed_main_menu();
200         wprintf("</BODY></HTML>\n");
201         wDumpContent();
202         }
203
204
205 void display_advanced_menu(void) {
206         printf("HTTP/1.0 200 OK\n");
207         output_headers(1);
208         embed_advanced_menu();
209         embed_main_menu();
210         wprintf("</BODY></HTML>\n");
211         wDumpContent();
212         }