4 * Displays and customizes the iconbar.
10 /* Values for ib_displayas */
15 void do_iconbar(void) {
18 char key[SIZ], value[SIZ];
21 /* The initialized values of these variables also happen to
22 * specify the default values for users who haven't customized
23 * their iconbars. These should probably be set in a master
24 * configuration somewhere.
26 int ib_displayas = 0; /* pictures and text, pictures, text */
27 int ib_logo = 0; /* Site logo */
28 int ib_summary = 1; /* Summary page icon */
29 int ib_inbox = 1; /* Inbox icon */
30 int ib_calendar = 1; /* Calendar icon */
31 int ib_contacts = 1; /* Contacts icon */
32 int ib_notes = 1; /* Notes icon */
33 int ib_tasks = 1; /* Tasks icon */
34 int ib_rooms = 1; /* Rooms icon */
35 int ib_users = 1; /* Users icon */
36 int ib_chat = 1; /* Chat icon */
37 int ib_advanced = 1; /* Advanced Options icon */
38 int ib_citadel = 1; /* 'Powered by Citadel' logo */
42 get_preference("iconbar", iconbar, sizeof iconbar);
43 for (i=0; i<num_tokens(iconbar, ','); ++i) {
44 extract_token(buf, iconbar, i, ',', sizeof buf);
45 extract_token(key, buf, 0, '=', sizeof key);
46 extract_token(value, buf, 1, '=', sizeof value);
48 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
49 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
50 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
51 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
52 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
53 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
54 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
55 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
56 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
57 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
58 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
59 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
60 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
63 wprintf("<div id=\"button\">\n"
69 if (ib_displayas != IB_TEXTONLY) {
70 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" "
71 "HEIGHT=\"32\" SRC=\"/image&name=hello\" ALT=\" \">\n"
77 if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
78 "<li><div align=\"center\">"
79 "<A HREF=\"http://www.citadel.org\" "
80 "title=\"Find out more about Citadel\" target=\"aboutcit\">"
82 "SRC=\"/static/citadel-logo.gif\" ALT=\"CITADEL\"></a>"
88 wprintf("<li><A HREF=\"/summary\" "
89 "TITLE=\"Your summary page\" "
92 if (ib_displayas != IB_TEXTONLY) {
93 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
94 "SRC=\"/static/summscreen_32x.gif\">");
96 if (ib_displayas != IB_PICONLY) {
99 wprintf("</A></li>\n");
104 "<A HREF=\"/dotgoto?room=_MAIL_\" "
105 "TITLE=\"Go to your e-mail inbox\" "
108 if (ib_displayas != IB_TEXTONLY) {
109 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
110 "SRC=\"/static/privatemess_32x.gif\">");
112 if (ib_displayas != IB_PICONLY) {
115 wprintf("</A></li>\n");
120 "<A HREF=\"/dotgoto?room=_CALENDAR_\" "
121 "TITLE=\"Go to your personal calendar\" "
124 if (ib_displayas != IB_TEXTONLY) {
125 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
126 "SRC=\"/static/calarea_32x.gif\">");
128 if (ib_displayas != IB_PICONLY) {
131 wprintf("</A></li>\n");
136 "<A HREF=\"/dotgoto?room=_CONTACTS_\" "
137 "TITLE=\"Go to your personal address book\" "
140 if (ib_displayas != IB_TEXTONLY) {
141 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
142 "SRC=\"/static/viewcontacts_32x.gif\">");
144 if (ib_displayas != IB_PICONLY) {
147 wprintf("</A></li>\n");
152 "<A HREF=\"/dotgoto?room=_NOTES_\" "
153 "TITLE=\"Go to your personal notes\" "
156 if (ib_displayas != IB_TEXTONLY) {
157 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
158 "SRC=\"/static/storenotes_32x.gif\">");
160 if (ib_displayas != IB_PICONLY) {
163 wprintf("</A></li>\n");
168 "<A HREF=\"/dotgoto?room=_TASKS_\" "
169 "TITLE=\"Go to your personal task list\" "
172 if (ib_displayas != IB_TEXTONLY) {
173 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
174 "SRC=\"/static/taskmanag_32x.gif\">");
176 if (ib_displayas != IB_PICONLY) {
179 wprintf("</A></li>\n");
184 "<A HREF=\"/knrooms\" TITLE=\"List all of your "
185 "accessible rooms\" >"
187 if (ib_displayas != IB_TEXTONLY) {
188 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
189 "SRC=\"/static/chatrooms_32x.gif\">");
191 if (ib_displayas != IB_PICONLY) {
194 wprintf("</A></li>\n");
199 "<A HREF=\"/who\" TITLE=\"See who is online right now\" "
202 if (ib_displayas != IB_TEXTONLY) {
203 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
204 "SRC=\"/static/usermanag_32x.gif\">");
206 if (ib_displayas != IB_PICONLY) {
207 wprintf("Who is online?");
209 wprintf("</A></li>\n");
214 "<A HREF=\"#\" onClick=\"window.open('/chat', "
215 "'ctdl_chat_window', "
216 "'toolbar=no,location=no,directories=no,copyhistory=no,"
217 "status=no,scrollbars=yes,resizable=yes');\""
220 if (ib_displayas != IB_TEXTONLY) {
221 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
222 "SRC=\"/static/citadelchat_32x.gif\">");
224 if (ib_displayas != IB_PICONLY) {
227 wprintf("</A></li>\n");
232 "<A HREF=\"/display_main_menu\" "
233 "TITLE=\"Advanced Options Menu: Advanced Room commands, "
234 "Account Info, and Chat\" "
237 if (ib_displayas != IB_TEXTONLY) {
238 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
239 "SRC=\"/static/advanpage2_32x.gif\">");
241 if (ib_displayas != IB_PICONLY) {
244 wprintf("</A></li>\n");
247 if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
249 "<A HREF=\"/display_aide_menu\" "
250 "TITLE=\"Room and system administration functions\" "
253 if (ib_displayas != IB_TEXTONLY) {
254 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
255 "SRC=\"/static/advanpage2_32x.gif\">");
257 if (ib_displayas != IB_PICONLY) {
258 wprintf("Administration");
260 wprintf("</A></li>\n");
265 "<A HREF=\"/termquit\" TITLE=\"Log off\" "
266 "onClick=\"return confirm('Log off now?');\">"
268 if (ib_displayas != IB_TEXTONLY) {
269 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
270 "SRC=\"/static/logoff_32x.gif\">");
272 if (ib_displayas != IB_PICONLY) {
275 wprintf("</A></li>\n");
279 "<li><div align=\"center\">"
280 "<A HREF=\"/display_customize_iconbar\" "
281 "TITLE=\"Customize this menu\" "
282 ">customize this menu"
292 void display_customize_iconbar(void) {
295 char key[SIZ], value[SIZ];
299 /* The initialized values of these variables also happen to
300 * specify the default values for users who haven't customized
301 * their iconbars. These should probably be set in a master
302 * configuration somewhere.
304 int ib_displayas = IB_PICTEXT; /* pictures and text, pictures, text */
305 int ib_logo = 0; /* Site logo */
306 int ib_summary = 1; /* Summary page icon */
307 int ib_inbox = 1; /* Inbox icon */
308 int ib_calendar = 1; /* Calendar icon */
309 int ib_contacts = 1; /* Contacts icon */
310 int ib_notes = 1; /* Notes icon */
311 int ib_tasks = 1; /* Tasks icon */
312 int ib_rooms = 1; /* Rooms icon */
313 int ib_users = 1; /* Users icon */
314 int ib_chat = 1; /* Chat icon */
315 int ib_advanced = 1; /* Advanced Options icon */
316 int ib_citadel = 1; /* 'Powered by Citadel' logo */
320 get_preference("iconbar", iconbar, sizeof iconbar);
321 for (i=0; i<num_tokens(iconbar, ','); ++i) {
322 extract_token(buf, iconbar, i, ',', sizeof buf);
323 extract_token(key, buf, 0, '=', sizeof key);
324 extract_token(value, buf, 1, '=', sizeof value);
326 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
327 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
328 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
329 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
330 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
331 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
332 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
333 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
334 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
335 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
336 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
337 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
338 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
341 output_headers(1, 1, 2, 0, 0, 0, 0);
342 wprintf("<div id=\"banner\">\n"
343 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
344 "<SPAN CLASS=\"titlebar\">Customize the icon bar</SPAN>"
345 "</TD></TR></TABLE>\n"
346 "</div>\n<div id=\"content\">\n"
349 wprintf("<div id=\"fix_scrollbar_bug\">"
350 "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>");
352 wprintf("<FORM METHOD=\"POST\" ACTION=\"/commit_iconbar\">\n");
355 "Display icons as: ");
356 for (i=0; i<=2; ++i) {
357 wprintf("<INPUT TYPE=\"radio\" NAME=\"ib_displayas\" VALUE=\"%d\"", i);
358 if (ib_displayas == i) wprintf(" CHECKED");
360 if (i == IB_PICTEXT) wprintf("pictures and text");
361 if (i == IB_PICONLY) wprintf("pictures only");
362 if (i == IB_TEXTONLY) wprintf("text only");
365 wprintf("<br /><br />\n");
367 wprintf("Select the icons you would like to see displayed "
368 "in the "icon bar" menu on the left side of the "
369 "screen.</CENTER><br />\n"
372 wprintf("<TABLE border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
374 wprintf("<TR BGCOLOR=%s><TD>"
375 "<INPUT TYPE=\"checkbox\" NAME=\"ib_logo\" VALUE=\"yes\" %s>"
377 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
378 "SRC=\"/image&name=hello\" ALT=\" \">"
380 "<B>Site logo</B><br />"
381 "An icon describing this site"
383 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
384 (ib_logo ? "CHECKED" : "")
387 wprintf("<TR bgcolor=%s><TD>"
388 "<INPUT TYPE=\"checkbox\" NAME=\"ib_summary\" VALUE=\"yes\" %s>"
390 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
391 "SRC=\"/static/summscreen_48x.gif\" ALT=\" \">"
393 "<B>Summary</B><br />"
396 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
397 (ib_summary ? "CHECKED" : "")
400 wprintf("<TR bgcolor=%s><TD>"
401 "<INPUT TYPE=\"checkbox\" NAME=\"ib_inbox\" VALUE=\"yes\" %s>"
403 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
404 "SRC=\"/static/privatemess_48x.gif\" ALT=\" \">"
406 "<B>Mail (inbox)</B><br />"
407 "A shortcut to your e-mail Inbox."
409 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
410 (ib_inbox ? "CHECKED" : "")
413 wprintf("<TR bgcolor=%s><TD>"
414 "<INPUT TYPE=\"checkbox\" NAME=\"ib_contacts\" "
417 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
418 "SRC=\"/static/viewcontacts_48x.gif\" ALT=\" \">"
420 "<B>Contacts</B><br />"
421 "Your personal address book."
423 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
424 (ib_contacts ? "CHECKED" : "")
427 wprintf("<TR bgcolor=%s><TD>"
428 "<INPUT TYPE=\"checkbox\" NAME=\"ib_notes\" "
431 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
432 "SRC=\"/static/storenotes_48x.gif\" ALT=\" \">"
435 "Your personal notes."
437 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
438 (ib_notes ? "CHECKED" : "")
441 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
442 wprintf("<TR bgcolor=%s><TD>"
443 "<INPUT TYPE=\"checkbox\" NAME=\"ib_calendar\" "
446 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
447 "SRC=\"/static/calarea_48x.gif\" ALT=\" \">"
449 "<B>Calendar</B><br />"
450 "A shortcut to your personal calendar."
452 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
453 (ib_calendar ? "CHECKED" : "")
456 wprintf("<TR bgcolor=%s><TD>"
457 "<INPUT TYPE=\"checkbox\" NAME=\"ib_tasks\" VALUE=\"yes\" %s>"
459 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
460 "SRC=\"/static/taskmanag_48x.gif\" ALT=\" \">"
463 "A shortcut to your personal task list."
465 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
466 (ib_tasks ? "CHECKED" : "")
468 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
470 wprintf("<TR bgcolor=%s><TD>"
471 "<INPUT TYPE=\"checkbox\" NAME=\"ib_rooms\" VALUE=\"yes\" %s>"
473 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
474 "SRC=\"/static/chatrooms_48x.gif\" ALT=\" \">"
477 "Clicking this icon displays a list of all accesible "
478 "rooms (or folders) available."
480 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
481 (ib_rooms ? "CHECKED" : "")
484 wprintf("<TR bgcolor=%s><TD>"
485 "<INPUT TYPE=\"checkbox\" NAME=\"ib_users\" VALUE=\"yes\" %s>"
487 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
488 "SRC=\"/static/usermanag_48x.gif\" ALT=\" \">"
490 "<B>Who is online?</B><br />"
491 "Clicking this icon displays a list of all users "
492 "currently logged in."
494 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
495 (ib_users ? "CHECKED" : "")
498 wprintf("<TR bgcolor=%s><TD>"
499 "<INPUT TYPE=\"checkbox\" NAME=\"ib_chat\" VALUE=\"yes\" %s>"
501 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
502 "SRC=\"/static/citadelchat_48x.gif\" ALT=\" \">"
505 "Clicking this icon enters real-time chat mode "
506 "with other users in the same room."
508 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
509 (ib_chat ? "CHECKED" : "")
512 wprintf("<TR bgcolor=%s><TD>"
513 "<INPUT TYPE=\"checkbox\" NAME=\"ib_advanced\" "
516 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
517 "SRC=\"/static/advanpage2_48x.gif\" ALT=\" \">"
519 "<B>Advanced options</B><br />"
520 "Access to the complete menu of Citadel functions."
522 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
523 (ib_advanced ? "CHECKED" : "")
526 wprintf("<TR bgcolor=%s><TD>"
527 "<INPUT TYPE=\"checkbox\" NAME=\"ib_citadel\" "
530 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
531 "SRC=\"/static/citadel-logo.gif\" ALT=\" \">"
533 "<B>Citadel logo</B><br />"
534 "Displays the "Powered by Citadel" icon"
536 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
537 (ib_citadel ? "CHECKED" : "")
540 wprintf("</TABLE><br />\n"
542 "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">"
544 "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">"
548 wprintf("</td></tr></table></div>\n");
553 void commit_iconbar(void) {
573 if (strcmp(bstr("sc"), "OK")) {
578 sprintf(iconbar, "ib_displayas=%d", atoi(bstr("ib_displayas")));
580 for (i=0; i<(sizeof(boxen)/sizeof(char *)); ++i) {
581 sprintf(&iconbar[strlen(iconbar)], ",%s=", boxen[i]);
582 if (!strcasecmp(bstr(boxen[i]), "yes")) {
583 sprintf(&iconbar[strlen(iconbar)], "1");
586 sprintf(&iconbar[strlen(iconbar)], "0");
590 set_preference("iconbar", iconbar, 1);
592 output_headers(1, 1, 0, 0, 0, 0, 0);
594 "<center><table border=1 bgcolor=\"#ffffff\"><tr><td>"
595 "<IMG SRC=\"/static/advanpage2_48x.gif\">"
597 "Your icon bar has been updated. Please select any of its "
598 "choices to continue."
599 "</td></tr></table>\n"