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><a href=\"javascript:switch_to_room_list()\">switch to room list</a>\n");
92 wprintf("<li><a href=\"summary\" "
94 ">", _("Your summary page")
96 if (ib_displayas != IB_TEXTONLY) {
97 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
98 "src=\"static/summscreen_32x.gif\">");
100 if (ib_displayas != IB_PICONLY) {
101 wprintf(_("Summary"));
103 wprintf("</A></li>\n");
108 "<a href=\"dotgoto?room=_MAIL_\" "
111 _("Go to your email inbox")
113 if (ib_displayas != IB_TEXTONLY) {
114 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
115 "src=\"static/privatemess_32x.gif\">");
117 if (ib_displayas != IB_PICONLY) {
119 if (WC->new_mail != WC->remember_new_mail) {
121 if (WC->new_mail > 0) {
122 wprintf(" <b>(%d)</b>", WC->new_mail);
125 WC->remember_new_mail = WC->new_mail;
128 wprintf("</A></li>\n");
133 "<a href=\"dotgoto?room=_CALENDAR_\" "
136 _("Go to your personal calendar")
138 if (ib_displayas != IB_TEXTONLY) {
139 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
140 "src=\"static/calarea_32x.gif\">");
142 if (ib_displayas != IB_PICONLY) {
143 wprintf(_("Calendar"));
145 wprintf("</A></li>\n");
150 "<a href=\"dotgoto?room=_CONTACTS_\" "
153 _("Go to your personal address book")
155 if (ib_displayas != IB_TEXTONLY) {
156 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
157 "src=\"static/viewcontacts_32x.gif\">");
159 if (ib_displayas != IB_PICONLY) {
160 wprintf(_("Contacts"));
162 wprintf("</A></li>\n");
167 "<a href=\"dotgoto?room=_NOTES_\" "
170 _("Go to your personal notes")
172 if (ib_displayas != IB_TEXTONLY) {
173 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
174 "src=\"static/storenotes_32x.gif\">");
176 if (ib_displayas != IB_PICONLY) {
179 wprintf("</A></li>\n");
184 "<a href=\"dotgoto?room=_TASKS_\" "
187 _("Go to your personal task list")
189 if (ib_displayas != IB_TEXTONLY) {
190 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
191 "src=\"static/taskmanag_32x.gif\">");
193 if (ib_displayas != IB_PICONLY) {
196 wprintf("</A></li>\n");
201 "<a href=\"knrooms\" TITLE=\"%s\" >",
202 _("List all of your accessible rooms")
204 if (ib_displayas != IB_TEXTONLY) {
205 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
206 "src=\"static/chatrooms_32x.gif\">");
208 if (ib_displayas != IB_PICONLY) {
211 wprintf("</A></li>\n");
216 "<a href=\"who\" TITLE=\"%s\" "
218 _("See who is online right now")
220 if (ib_displayas != IB_TEXTONLY) {
221 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
222 "src=\"static/usermanag_32x.gif\">");
224 if (ib_displayas != IB_PICONLY) {
225 wprintf(_("Who is online?"));
227 wprintf("</A></li>\n");
232 "<a href=\"#\" onClick=\"window.open('chat', "
233 "'ctdl_chat_window', "
234 "'toolbar=no,location=no,directories=no,copyhistory=no,"
235 "status=no,scrollbars=yes,resizable=yes');\""
238 if (ib_displayas != IB_TEXTONLY) {
239 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
240 "src=\"static/citadelchat_32x.gif\">");
242 if (ib_displayas != IB_PICONLY) {
245 wprintf("</A></li>\n");
250 "<a href=\"display_main_menu\" "
253 _("Advanced Options Menu: Advanced Room commands, Account Info, and Chat")
255 if (ib_displayas != IB_TEXTONLY) {
256 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
257 "src=\"static/advanpage2_32x.gif\">");
259 if (ib_displayas != IB_PICONLY) {
260 wprintf(_("Advanced"));
262 wprintf("</A></li>\n");
265 if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
267 "<a href=\"display_aide_menu\" "
270 _("Room and system administration functions")
272 if (ib_displayas != IB_TEXTONLY) {
273 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
274 "src=\"static/advanpage2_32x.gif\">");
276 if (ib_displayas != IB_PICONLY) {
277 wprintf(_("Administration"));
279 wprintf("</A></li>\n");
284 "<a href=\"termquit\" TITLE=\"%s\" "
285 "onClick=\"return confirm('%s');\">",
290 if (ib_displayas != IB_TEXTONLY) {
291 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
292 "src=\"static/logoff_32x.gif\">");
294 if (ib_displayas != IB_PICONLY) {
295 wprintf(_("Log off"));
297 wprintf("</A></li>\n");
301 "<li><div align=\"center\">"
302 "<a href=\"display_customize_iconbar\" "
306 _("Customize this menu"),
307 _("customize this menu")
312 wprintf("<div id=\"dropstuff\" style=\"font-size:6pt\">");
313 wprintf("Drag to trash here...<br>");
321 * If the user has toggled the icon bar over to a room list, here's where
322 * we generate its innerHTML...
324 void do_iconbar_roomlist(void) {
327 char key[SIZ], value[SIZ];
330 /* The initialized values of these variables also happen to
331 * specify the default values for users who haven't customized
332 * their iconbars. These should probably be set in a master
333 * configuration somewhere.
335 int ib_displayas = 0; /* pictures and text, pictures, text */
336 int ib_logo = 0; /* Site logo */
337 int ib_citadel = 1; /* 'Powered by Citadel' logo */
341 get_preference("iconbar", iconbar, sizeof iconbar);
342 for (i=0; i<num_tokens(iconbar, ','); ++i) {
343 extract_token(buf, iconbar, i, ',', sizeof buf);
344 extract_token(key, buf, 0, '=', sizeof key);
345 extract_token(value, buf, 1, '=', sizeof value);
347 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
348 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
349 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
352 wprintf("<div id=\"button\">\n"
358 if (ib_displayas != IB_TEXTONLY) {
359 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" "
360 "HEIGHT=\"32\" src=\"image&name=hello\" ALT=\" \">\n"
366 if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
367 "<li><div align=\"center\">"
368 "<a href=\"http://www.citadel.org\" "
369 "title=\"%s\" target=\"aboutcit\">"
371 "src=\"static/citadel-logo.gif\" ALT=\"%s\"></a>"
373 _("Find out more about Citadel"),
377 wprintf("<li><a href=\"javascript:switch_to_menu_buttons()\">back to menu...</a>");
381 /* embed the room list */
382 list_all_rooms_by_floor("iconbar");
384 wprintf("<div id=\"dropstuff\" style=\"font-size:6pt\">");
385 wprintf("Drag to trash here...<br>");
393 void display_customize_iconbar(void) {
396 char key[SIZ], value[SIZ];
400 /* The initialized values of these variables also happen to
401 * specify the default values for users who haven't customized
402 * their iconbars. These should probably be set in a master
403 * configuration somewhere.
405 int ib_displayas = IB_PICTEXT; /* pictures and text, pictures, text */
406 int ib_logo = 0; /* Site logo */
407 int ib_summary = 1; /* Summary page icon */
408 int ib_inbox = 1; /* Inbox icon */
409 int ib_calendar = 1; /* Calendar icon */
410 int ib_contacts = 1; /* Contacts icon */
411 int ib_notes = 1; /* Notes icon */
412 int ib_tasks = 1; /* Tasks icon */
413 int ib_rooms = 1; /* Rooms icon */
414 int ib_users = 1; /* Users icon */
415 int ib_chat = 1; /* Chat icon */
416 int ib_advanced = 1; /* Advanced Options icon */
417 int ib_citadel = 1; /* 'Powered by Citadel' logo */
421 get_preference("iconbar", iconbar, sizeof iconbar);
422 for (i=0; i<num_tokens(iconbar, ','); ++i) {
423 extract_token(buf, iconbar, i, ',', sizeof buf);
424 extract_token(key, buf, 0, '=', sizeof key);
425 extract_token(value, buf, 1, '=', sizeof value);
427 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
428 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
429 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
430 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
431 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
432 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
433 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
434 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
435 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
436 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
437 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
438 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
439 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
442 output_headers(1, 1, 2, 0, 0, 0);
443 wprintf("<div id=\"banner\">\n"
444 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
445 "<SPAN CLASS=\"titlebar\">");
446 wprintf(_("Customize the icon bar"));
448 "</TD></TR></TABLE>\n"
449 "</div>\n<div id=\"content\">\n"
452 wprintf("<div id=\"fix_scrollbar_bug\">"
453 "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>");
455 wprintf("<FORM METHOD=\"POST\" action=\"commit_iconbar\">\n");
458 wprintf(_("Display icons as:"));
460 for (i=0; i<=2; ++i) {
461 wprintf("<INPUT TYPE=\"radio\" NAME=\"ib_displayas\" VALUE=\"%d\"", i);
462 if (ib_displayas == i) wprintf(" CHECKED");
464 if (i == IB_PICTEXT) wprintf(_("pictures and text"));
465 if (i == IB_PICONLY) wprintf(_("pictures only"));
466 if (i == IB_TEXTONLY) wprintf(_("text only"));
469 wprintf("<br /><br />\n");
471 wprintf(_("Select the icons you would like to see displayed "
472 "in the 'icon bar' menu on the left side of the "
474 wprintf("</CENTER><br />\n");
476 wprintf("<TABLE border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
478 wprintf("<TR BGCOLOR=%s><TD>"
479 "<INPUT TYPE=\"checkbox\" NAME=\"ib_logo\" VALUE=\"yes\" %s>"
481 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
482 "src=\"image&name=hello\" ALT=\" \">"
487 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
488 (ib_logo ? "CHECKED" : ""),
490 _("An icon describing this site")
493 wprintf("<TR bgcolor=%s><TD>"
494 "<INPUT TYPE=\"checkbox\" NAME=\"ib_summary\" VALUE=\"yes\" %s>"
496 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
497 "src=\"static/summscreen_48x.gif\" ALT=\" \">"
502 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
503 (ib_summary ? "CHECKED" : ""),
505 _("Your summary page")
508 wprintf("<TR bgcolor=%s><TD>"
509 "<INPUT TYPE=\"checkbox\" NAME=\"ib_inbox\" VALUE=\"yes\" %s>"
511 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
512 "src=\"static/privatemess_48x.gif\" ALT=\" \">"
517 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
518 (ib_inbox ? "CHECKED" : ""),
520 _("A shortcut to your email Inbox")
523 wprintf("<TR bgcolor=%s><TD>"
524 "<INPUT TYPE=\"checkbox\" NAME=\"ib_contacts\" "
527 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
528 "src=\"static/viewcontacts_48x.gif\" ALT=\" \">"
533 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
534 (ib_contacts ? "CHECKED" : ""),
536 _("Your personal address book")
539 wprintf("<TR bgcolor=%s><TD>"
540 "<INPUT TYPE=\"checkbox\" NAME=\"ib_notes\" "
543 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
544 "src=\"static/storenotes_48x.gif\" ALT=\" \">"
549 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
550 (ib_notes ? "CHECKED" : ""),
552 _("Your personal notes")
555 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
556 wprintf("<TR bgcolor=%s><TD>"
557 "<INPUT TYPE=\"checkbox\" NAME=\"ib_calendar\" "
560 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
561 "src=\"static/calarea_48x.gif\" ALT=\" \">"
566 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
567 (ib_calendar ? "CHECKED" : ""),
569 _("A shortcut to your personal calendar")
572 wprintf("<TR bgcolor=%s><TD>"
573 "<INPUT TYPE=\"checkbox\" NAME=\"ib_tasks\" VALUE=\"yes\" %s>"
575 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
576 "src=\"static/taskmanag_48x.gif\" ALT=\" \">"
581 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
582 (ib_tasks ? "CHECKED" : ""),
584 _("A shortcut to your personal task list")
586 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
588 wprintf("<TR bgcolor=%s><TD>"
589 "<INPUT TYPE=\"checkbox\" NAME=\"ib_rooms\" VALUE=\"yes\" %s>"
591 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
592 "src=\"static/chatrooms_48x.gif\" ALT=\" \">"
597 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
598 (ib_rooms ? "CHECKED" : ""),
600 _("Clicking this icon displays a list of all accesible "
601 "rooms (or folders) available.")
604 wprintf("<TR bgcolor=%s><TD>"
605 "<INPUT TYPE=\"checkbox\" NAME=\"ib_users\" VALUE=\"yes\" %s>"
607 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
608 "src=\"static/usermanag_48x.gif\" ALT=\" \">"
613 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
614 (ib_users ? "CHECKED" : ""),
616 _("Clicking this icon displays a list of all users "
617 "currently logged in.")
620 wprintf("<TR bgcolor=%s><TD>"
621 "<INPUT TYPE=\"checkbox\" NAME=\"ib_chat\" VALUE=\"yes\" %s>"
623 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
624 "src=\"static/citadelchat_48x.gif\" ALT=\" \">"
629 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
630 (ib_chat ? "CHECKED" : ""),
632 _("Clicking this icon enters real-time chat mode "
633 "with other users in the same room.")
637 wprintf("<TR bgcolor=%s><TD>"
638 "<INPUT TYPE=\"checkbox\" NAME=\"ib_advanced\" "
641 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
642 "src=\"static/advanpage2_48x.gif\" ALT=\" \">"
647 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
648 (ib_advanced ? "CHECKED" : ""),
649 _("Advanced options"),
650 _("Access to the complete menu of Citadel functions.")
654 wprintf("<TR bgcolor=%s><TD>"
655 "<INPUT TYPE=\"checkbox\" NAME=\"ib_citadel\" "
658 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
659 "src=\"static/citadel-logo.gif\" ALT=\" \">"
664 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
665 (ib_citadel ? "CHECKED" : ""),
667 _("Displays the 'Powered by Citadel' icon")
670 wprintf("</TABLE><br />\n"
672 "<INPUT TYPE=\"submit\" NAME=\"ok_button\" VALUE=\"%s\">"
674 "<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">"
675 "</CENTER></FORM>\n",
680 wprintf("</td></tr></table></div>\n");
685 void commit_iconbar(void) {
705 if (strlen(bstr("ok_button")) == 0) {
710 sprintf(iconbar, "ib_displayas=%d", atoi(bstr("ib_displayas")));
712 for (i=0; i<(sizeof(boxen)/sizeof(char *)); ++i) {
713 sprintf(&iconbar[strlen(iconbar)], ",%s=", boxen[i]);
714 if (!strcasecmp(bstr(boxen[i]), "yes")) {
715 sprintf(&iconbar[strlen(iconbar)], "1");
718 sprintf(&iconbar[strlen(iconbar)], "0");
722 set_preference("iconbar", iconbar, 1);
724 output_headers(1, 1, 0, 0, 0, 0);
726 "<center><table border=1 bgcolor=\"#ffffff\"><tr><td>"
727 "<img src=\"static/advanpage2_48x.gif\">"
729 wprintf(_("Your icon bar has been updated. Please select any of its "
730 "choices to continue."));
731 wprintf("</td></tr></table>\n");