4 * Displays and customizes the iconbar.
10 /* Values for ib_displayas */
16 void do_iconbar(void) {
19 char key[SIZ], value[SIZ];
22 /* The initialized values of these variables also happen to
23 * specify the default values for users who haven't customized
24 * their iconbars. These should probably be set in a master
25 * configuration somewhere.
27 int ib_displayas = 0; /* pictures and text, pictures, text */
28 int ib_logo = 0; /* Site logo */
29 int ib_summary = 1; /* Summary page icon */
30 int ib_inbox = 1; /* Inbox icon */
31 int ib_calendar = 1; /* Calendar icon */
32 int ib_contacts = 1; /* Contacts icon */
33 int ib_notes = 1; /* Notes icon */
34 int ib_tasks = 1; /* Tasks icon */
35 int ib_rooms = 1; /* Rooms icon */
36 int ib_users = 1; /* Users icon */
37 int ib_chat = 1; /* Chat icon */
38 int ib_advanced = 1; /* Advanced Options icon */
39 int ib_citadel = 1; /* 'Powered by Citadel' logo */
43 get_preference("iconbar", iconbar, sizeof iconbar);
44 for (i=0; i<num_tokens(iconbar, ','); ++i) {
45 extract_token(buf, iconbar, i, ',', sizeof buf);
46 extract_token(key, buf, 0, '=', sizeof key);
47 extract_token(value, buf, 1, '=', sizeof value);
49 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
50 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
51 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
52 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
53 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
54 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
55 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
56 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
57 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
58 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
59 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
60 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
61 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
64 wprintf("<div id=\"button\">\n"
70 if (ib_displayas != IB_TEXTONLY) {
71 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" "
72 "HEIGHT=\"32\" src=\"image&name=hello\" ALT=\" \">\n"
78 if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
79 "<li><div align=\"center\">"
80 "<a href=\"http://www.citadel.org\" "
81 "title=\"%s\" target=\"aboutcit\">"
83 "src=\"static/citadel-logo.gif\" ALT=\"%s\"></a>"
85 _("Find out more about Citadel"),
89 wprintf("<li><div align=\"center\">"
90 "<a href=\"javascript:switch_to_room_list()\">switch to room list</a>"
95 wprintf("<li><a href=\"summary\" "
97 ">", _("Your summary page")
99 if (ib_displayas != IB_TEXTONLY) {
100 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
101 "src=\"static/summscreen_32x.gif\">");
103 if (ib_displayas != IB_PICONLY) {
104 wprintf(_("Summary"));
106 wprintf("</A></li>\n");
111 "<a href=\"dotgoto?room=_MAIL_\" "
114 _("Go to your email inbox")
116 if (ib_displayas != IB_TEXTONLY) {
117 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
118 "src=\"static/privatemess_32x.gif\">");
120 if (ib_displayas != IB_PICONLY) {
122 if (WC->new_mail != WC->remember_new_mail) {
124 if (WC->new_mail > 0) {
125 wprintf(" <b>(%d)</b>", WC->new_mail);
128 WC->remember_new_mail = WC->new_mail;
131 wprintf("</A></li>\n");
136 "<a href=\"dotgoto?room=_CALENDAR_\" "
139 _("Go to your personal calendar")
141 if (ib_displayas != IB_TEXTONLY) {
142 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
143 "src=\"static/calarea_32x.gif\">");
145 if (ib_displayas != IB_PICONLY) {
146 wprintf(_("Calendar"));
148 wprintf("</A></li>\n");
153 "<a href=\"dotgoto?room=_CONTACTS_\" "
156 _("Go to your personal address book")
158 if (ib_displayas != IB_TEXTONLY) {
159 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
160 "src=\"static/viewcontacts_32x.gif\">");
162 if (ib_displayas != IB_PICONLY) {
163 wprintf(_("Contacts"));
165 wprintf("</A></li>\n");
170 "<a href=\"dotgoto?room=_NOTES_\" "
173 _("Go to your personal notes")
175 if (ib_displayas != IB_TEXTONLY) {
176 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
177 "src=\"static/storenotes_32x.gif\">");
179 if (ib_displayas != IB_PICONLY) {
182 wprintf("</A></li>\n");
187 "<a href=\"dotgoto?room=_TASKS_\" "
190 _("Go to your personal task list")
192 if (ib_displayas != IB_TEXTONLY) {
193 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
194 "src=\"static/taskmanag_32x.gif\">");
196 if (ib_displayas != IB_PICONLY) {
199 wprintf("</A></li>\n");
204 "<a href=\"knrooms\" TITLE=\"%s\" >",
205 _("List all of your accessible rooms")
207 if (ib_displayas != IB_TEXTONLY) {
208 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
209 "src=\"static/chatrooms_32x.gif\">");
211 if (ib_displayas != IB_PICONLY) {
214 wprintf("</A></li>\n");
219 "<a href=\"who\" TITLE=\"%s\" "
221 _("See who is online right now")
223 if (ib_displayas != IB_TEXTONLY) {
224 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
225 "src=\"static/usermanag_32x.gif\">");
227 if (ib_displayas != IB_PICONLY) {
228 wprintf(_("Who is online?"));
230 wprintf("</A></li>\n");
235 "<a href=\"#\" onClick=\"window.open('chat', "
236 "'ctdl_chat_window', "
237 "'toolbar=no,location=no,directories=no,copyhistory=no,"
238 "status=no,scrollbars=yes,resizable=yes');\""
241 if (ib_displayas != IB_TEXTONLY) {
242 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
243 "src=\"static/citadelchat_32x.gif\">");
245 if (ib_displayas != IB_PICONLY) {
248 wprintf("</A></li>\n");
253 "<a href=\"display_main_menu\" "
256 _("Advanced Options Menu: Advanced Room commands, Account Info, and Chat")
258 if (ib_displayas != IB_TEXTONLY) {
259 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
260 "src=\"static/advanpage2_32x.gif\">");
262 if (ib_displayas != IB_PICONLY) {
263 wprintf(_("Advanced"));
265 wprintf("</A></li>\n");
268 if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
270 "<a href=\"display_aide_menu\" "
273 _("Room and system administration functions")
275 if (ib_displayas != IB_TEXTONLY) {
276 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
277 "src=\"static/advanpage2_32x.gif\">");
279 if (ib_displayas != IB_PICONLY) {
280 wprintf(_("Administration"));
282 wprintf("</A></li>\n");
287 "<a href=\"termquit\" TITLE=\"%s\" "
288 "onClick=\"return confirm('%s');\">",
293 if (ib_displayas != IB_TEXTONLY) {
294 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
295 "src=\"static/logoff_32x.gif\">");
297 if (ib_displayas != IB_PICONLY) {
298 wprintf(_("Log off"));
300 wprintf("</A></li>\n");
304 "<li><div align=\"center\">"
305 "<a href=\"display_customize_iconbar\" "
309 _("Customize this menu"),
310 _("customize this menu")
316 wprintf("<div id=\"dropstuff\" style=\"font-size:6pt\">");
317 wprintf("Drag to trash here...<br>");
326 * If the user has toggled the icon bar over to a room list, here's where
327 * we generate its innerHTML...
329 void do_iconbar_roomlist(void) {
332 char key[SIZ], value[SIZ];
335 /* The initialized values of these variables also happen to
336 * specify the default values for users who haven't customized
337 * their iconbars. These should probably be set in a master
338 * configuration somewhere.
340 int ib_displayas = 0; /* pictures and text, pictures, text */
341 int ib_logo = 0; /* Site logo */
342 int ib_citadel = 1; /* 'Powered by Citadel' logo */
346 get_preference("iconbar", iconbar, sizeof iconbar);
347 for (i=0; i<num_tokens(iconbar, ','); ++i) {
348 extract_token(buf, iconbar, i, ',', sizeof buf);
349 extract_token(key, buf, 0, '=', sizeof key);
350 extract_token(value, buf, 1, '=', sizeof value);
352 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
353 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
354 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
357 wprintf("<div id=\"button\">\n"
363 if (ib_displayas != IB_TEXTONLY) {
364 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" "
365 "HEIGHT=\"32\" src=\"image&name=hello\" ALT=\" \">\n"
371 if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
372 "<li><div align=\"center\">"
373 "<a href=\"http://www.citadel.org\" "
374 "title=\"%s\" target=\"aboutcit\">"
376 "src=\"static/citadel-logo.gif\" ALT=\"%s\"></a>"
378 _("Find out more about Citadel"),
382 wprintf("<li><div align=\"center\">"
383 "<a href=\"javascript:switch_to_menu_buttons()\">switch to menu</a>"
389 /* embed the room list */
390 list_all_rooms_by_floor("iconbar");
393 wprintf("<div id=\"dropstuff\" style=\"font-size:6pt\">");
394 wprintf("Drag to trash here...<br>");
403 void display_customize_iconbar(void) {
406 char key[SIZ], value[SIZ];
410 /* The initialized values of these variables also happen to
411 * specify the default values for users who haven't customized
412 * their iconbars. These should probably be set in a master
413 * configuration somewhere.
415 int ib_displayas = IB_PICTEXT; /* pictures and text, pictures, text */
416 int ib_logo = 0; /* Site logo */
417 int ib_summary = 1; /* Summary page icon */
418 int ib_inbox = 1; /* Inbox icon */
419 int ib_calendar = 1; /* Calendar icon */
420 int ib_contacts = 1; /* Contacts icon */
421 int ib_notes = 1; /* Notes icon */
422 int ib_tasks = 1; /* Tasks icon */
423 int ib_rooms = 1; /* Rooms icon */
424 int ib_users = 1; /* Users icon */
425 int ib_chat = 1; /* Chat icon */
426 int ib_advanced = 1; /* Advanced Options icon */
427 int ib_citadel = 1; /* 'Powered by Citadel' logo */
431 get_preference("iconbar", iconbar, sizeof iconbar);
432 for (i=0; i<num_tokens(iconbar, ','); ++i) {
433 extract_token(buf, iconbar, i, ',', sizeof buf);
434 extract_token(key, buf, 0, '=', sizeof key);
435 extract_token(value, buf, 1, '=', sizeof value);
437 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
438 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
439 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
440 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
441 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
442 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
443 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
444 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
445 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
446 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
447 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
448 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
449 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
452 output_headers(1, 1, 2, 0, 0, 0);
453 wprintf("<div id=\"banner\">\n"
454 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
455 "<SPAN CLASS=\"titlebar\">");
456 wprintf(_("Customize the icon bar"));
458 "</TD></TR></TABLE>\n"
459 "</div>\n<div id=\"content\">\n"
462 wprintf("<div id=\"fix_scrollbar_bug\">"
463 "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>");
465 wprintf("<FORM METHOD=\"POST\" action=\"commit_iconbar\">\n");
468 wprintf(_("Display icons as:"));
470 for (i=0; i<=2; ++i) {
471 wprintf("<INPUT TYPE=\"radio\" NAME=\"ib_displayas\" VALUE=\"%d\"", i);
472 if (ib_displayas == i) wprintf(" CHECKED");
474 if (i == IB_PICTEXT) wprintf(_("pictures and text"));
475 if (i == IB_PICONLY) wprintf(_("pictures only"));
476 if (i == IB_TEXTONLY) wprintf(_("text only"));
479 wprintf("<br /><br />\n");
481 wprintf(_("Select the icons you would like to see displayed "
482 "in the 'icon bar' menu on the left side of the "
484 wprintf("</CENTER><br />\n");
486 wprintf("<TABLE border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
488 wprintf("<TR BGCOLOR=%s><TD>"
489 "<INPUT TYPE=\"checkbox\" NAME=\"ib_logo\" VALUE=\"yes\" %s>"
491 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
492 "src=\"image&name=hello\" ALT=\" \">"
497 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
498 (ib_logo ? "CHECKED" : ""),
500 _("An icon describing this site")
503 wprintf("<TR bgcolor=%s><TD>"
504 "<INPUT TYPE=\"checkbox\" NAME=\"ib_summary\" VALUE=\"yes\" %s>"
506 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
507 "src=\"static/summscreen_48x.gif\" ALT=\" \">"
512 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
513 (ib_summary ? "CHECKED" : ""),
515 _("Your summary page")
518 wprintf("<TR bgcolor=%s><TD>"
519 "<INPUT TYPE=\"checkbox\" NAME=\"ib_inbox\" VALUE=\"yes\" %s>"
521 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
522 "src=\"static/privatemess_48x.gif\" ALT=\" \">"
527 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
528 (ib_inbox ? "CHECKED" : ""),
530 _("A shortcut to your email Inbox")
533 wprintf("<TR bgcolor=%s><TD>"
534 "<INPUT TYPE=\"checkbox\" NAME=\"ib_contacts\" "
537 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
538 "src=\"static/viewcontacts_48x.gif\" ALT=\" \">"
543 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
544 (ib_contacts ? "CHECKED" : ""),
546 _("Your personal address book")
549 wprintf("<TR bgcolor=%s><TD>"
550 "<INPUT TYPE=\"checkbox\" NAME=\"ib_notes\" "
553 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
554 "src=\"static/storenotes_48x.gif\" ALT=\" \">"
559 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
560 (ib_notes ? "CHECKED" : ""),
562 _("Your personal notes")
565 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
566 wprintf("<TR bgcolor=%s><TD>"
567 "<INPUT TYPE=\"checkbox\" NAME=\"ib_calendar\" "
570 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
571 "src=\"static/calarea_48x.gif\" ALT=\" \">"
576 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
577 (ib_calendar ? "CHECKED" : ""),
579 _("A shortcut to your personal calendar")
582 wprintf("<TR bgcolor=%s><TD>"
583 "<INPUT TYPE=\"checkbox\" NAME=\"ib_tasks\" VALUE=\"yes\" %s>"
585 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
586 "src=\"static/taskmanag_48x.gif\" ALT=\" \">"
591 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
592 (ib_tasks ? "CHECKED" : ""),
594 _("A shortcut to your personal task list")
596 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
598 wprintf("<TR bgcolor=%s><TD>"
599 "<INPUT TYPE=\"checkbox\" NAME=\"ib_rooms\" VALUE=\"yes\" %s>"
601 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
602 "src=\"static/chatrooms_48x.gif\" ALT=\" \">"
607 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
608 (ib_rooms ? "CHECKED" : ""),
610 _("Clicking this icon displays a list of all accesible "
611 "rooms (or folders) available.")
614 wprintf("<TR bgcolor=%s><TD>"
615 "<INPUT TYPE=\"checkbox\" NAME=\"ib_users\" VALUE=\"yes\" %s>"
617 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
618 "src=\"static/usermanag_48x.gif\" ALT=\" \">"
623 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
624 (ib_users ? "CHECKED" : ""),
626 _("Clicking this icon displays a list of all users "
627 "currently logged in.")
630 wprintf("<TR bgcolor=%s><TD>"
631 "<INPUT TYPE=\"checkbox\" NAME=\"ib_chat\" VALUE=\"yes\" %s>"
633 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
634 "src=\"static/citadelchat_48x.gif\" ALT=\" \">"
639 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
640 (ib_chat ? "CHECKED" : ""),
642 _("Clicking this icon enters real-time chat mode "
643 "with other users in the same room.")
647 wprintf("<TR bgcolor=%s><TD>"
648 "<INPUT TYPE=\"checkbox\" NAME=\"ib_advanced\" "
651 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
652 "src=\"static/advanpage2_48x.gif\" ALT=\" \">"
657 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
658 (ib_advanced ? "CHECKED" : ""),
659 _("Advanced options"),
660 _("Access to the complete menu of Citadel functions.")
664 wprintf("<TR bgcolor=%s><TD>"
665 "<INPUT TYPE=\"checkbox\" NAME=\"ib_citadel\" "
668 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
669 "src=\"static/citadel-logo.gif\" ALT=\" \">"
674 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
675 (ib_citadel ? "CHECKED" : ""),
677 _("Displays the 'Powered by Citadel' icon")
680 wprintf("</TABLE><br />\n"
682 "<INPUT TYPE=\"submit\" NAME=\"ok_button\" VALUE=\"%s\">"
684 "<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">"
685 "</CENTER></FORM>\n",
690 wprintf("</td></tr></table></div>\n");
695 void commit_iconbar(void) {
715 if (strlen(bstr("ok_button")) == 0) {
720 sprintf(iconbar, "ib_displayas=%d", atoi(bstr("ib_displayas")));
722 for (i=0; i<(sizeof(boxen)/sizeof(char *)); ++i) {
723 sprintf(&iconbar[strlen(iconbar)], ",%s=", boxen[i]);
724 if (!strcasecmp(bstr(boxen[i]), "yes")) {
725 sprintf(&iconbar[strlen(iconbar)], "1");
728 sprintf(&iconbar[strlen(iconbar)], "0");
732 set_preference("iconbar", iconbar, 1);
734 output_headers(1, 1, 0, 0, 0, 0);
736 "<center><table border=1 bgcolor=\"#ffffff\"><tr><td>"
737 "<img src=\"static/advanpage2_48x.gif\">"
739 wprintf(_("Your icon bar has been updated. Please select any of its "
740 "choices to continue."));
741 wprintf("</td></tr></table>\n");