4 * Displays and customizes the iconbar.
10 /* Values for ib_displayas */
16 void do_selected_iconbar(void) {
17 if (WC->current_iconbar == current_iconbar_roomlist) {
18 do_iconbar_roomlist();
26 void do_iconbar(void) {
29 char key[SIZ], value[SIZ];
32 WC->current_iconbar = current_iconbar_menu;
34 /* The initialized values of these variables also happen to
35 * specify the default values for users who haven't customized
36 * their iconbars. These should probably be set in a master
37 * configuration somewhere.
39 int ib_displayas = 0; /* pictures and text, pictures, text */
40 int ib_logo = 0; /* Site logo */
41 int ib_summary = 1; /* Summary page icon */
42 int ib_inbox = 1; /* Inbox icon */
43 int ib_calendar = 1; /* Calendar icon */
44 int ib_contacts = 1; /* Contacts icon */
45 int ib_notes = 1; /* Notes icon */
46 int ib_tasks = 1; /* Tasks icon */
47 int ib_rooms = 1; /* Rooms icon */
48 int ib_users = 1; /* Users icon */
49 int ib_chat = 1; /* Chat icon */
50 int ib_advanced = 1; /* Advanced Options icon */
51 int ib_citadel = 1; /* 'Powered by Citadel' logo */
55 get_preference("iconbar", iconbar, sizeof iconbar);
56 for (i=0; i<num_tokens(iconbar, ','); ++i) {
57 extract_token(buf, iconbar, i, ',', sizeof buf);
58 extract_token(key, buf, 0, '=', sizeof key);
59 extract_token(value, buf, 1, '=', sizeof value);
61 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
62 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
63 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
64 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
65 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
66 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
67 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
68 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
69 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
70 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
71 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
72 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
73 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
76 wprintf("<div id=\"button\">\n"
82 if (ib_displayas != IB_TEXTONLY) {
83 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" "
84 "HEIGHT=\"32\" src=\"image&name=hello\" ALT=\" \">\n"
90 if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
91 "<li><div align=\"center\">"
92 "<a href=\"http://www.citadel.org\" "
93 "title=\"%s\" target=\"aboutcit\">"
95 "src=\"static/citadel-logo.gif\" ALT=\"%s\"></a>"
97 _("Find out more about Citadel"),
101 wprintf("<li><div align=\"center\"><a href=\"javascript:switch_to_room_list()\">");
102 wprintf(_("switch to room list"));
103 wprintf("</a></div>");
106 wprintf("<li><a href=\"summary\" "
108 ">", _("Your summary page")
110 if (ib_displayas != IB_TEXTONLY) {
111 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
112 "src=\"static/summscreen_32x.gif\">");
114 if (ib_displayas != IB_PICONLY) {
115 wprintf(_("Summary"));
117 wprintf("</A></li>\n");
122 "<a href=\"dotgoto?room=_MAIL_\" "
125 _("Go to your email inbox")
127 if (ib_displayas != IB_TEXTONLY) {
128 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
129 "src=\"static/privatemess_32x.gif\">");
131 if (ib_displayas != IB_PICONLY) {
133 if (WC->new_mail != WC->remember_new_mail) {
135 if (WC->new_mail > 0) {
136 wprintf(" <b>(%d)</b>", WC->new_mail);
139 WC->remember_new_mail = WC->new_mail;
142 wprintf("</A></li>\n");
147 "<a href=\"dotgoto?room=_CALENDAR_\" "
150 _("Go to your personal calendar")
152 if (ib_displayas != IB_TEXTONLY) {
153 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
154 "src=\"static/calarea_32x.gif\">");
156 if (ib_displayas != IB_PICONLY) {
157 wprintf(_("Calendar"));
159 wprintf("</A></li>\n");
164 "<a href=\"dotgoto?room=_CONTACTS_\" "
167 _("Go to your personal address book")
169 if (ib_displayas != IB_TEXTONLY) {
170 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
171 "src=\"static/viewcontacts_32x.gif\">");
173 if (ib_displayas != IB_PICONLY) {
174 wprintf(_("Contacts"));
176 wprintf("</A></li>\n");
181 "<a href=\"dotgoto?room=_NOTES_\" "
184 _("Go to your personal notes")
186 if (ib_displayas != IB_TEXTONLY) {
187 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
188 "src=\"static/storenotes_32x.gif\">");
190 if (ib_displayas != IB_PICONLY) {
193 wprintf("</A></li>\n");
198 "<a href=\"dotgoto?room=_TASKS_\" "
201 _("Go to your personal task list")
203 if (ib_displayas != IB_TEXTONLY) {
204 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
205 "src=\"static/taskmanag_32x.gif\">");
207 if (ib_displayas != IB_PICONLY) {
210 wprintf("</A></li>\n");
215 "<a href=\"knrooms\" TITLE=\"%s\" >",
216 _("List all of your accessible rooms")
218 if (ib_displayas != IB_TEXTONLY) {
219 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
220 "src=\"static/chatrooms_32x.gif\">");
222 if (ib_displayas != IB_PICONLY) {
225 wprintf("</A></li>\n");
230 "<a href=\"who\" TITLE=\"%s\" "
232 _("See who is online right now")
234 if (ib_displayas != IB_TEXTONLY) {
235 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
236 "src=\"static/usermanag_32x.gif\">");
238 if (ib_displayas != IB_PICONLY) {
239 wprintf(_("Who is online?"));
241 wprintf("</A></li>\n");
246 "<a href=\"#\" onClick=\"window.open('chat', "
247 "'ctdl_chat_window', "
248 "'toolbar=no,location=no,directories=no,copyhistory=no,"
249 "status=no,scrollbars=yes,resizable=yes');\""
252 if (ib_displayas != IB_TEXTONLY) {
253 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
254 "src=\"static/citadelchat_32x.gif\">");
256 if (ib_displayas != IB_PICONLY) {
259 wprintf("</A></li>\n");
264 "<a href=\"display_main_menu\" "
267 _("Advanced Options Menu: Advanced Room commands, Account Info, and Chat")
269 if (ib_displayas != IB_TEXTONLY) {
270 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
271 "src=\"static/advanpage2_32x.gif\">");
273 if (ib_displayas != IB_PICONLY) {
274 wprintf(_("Advanced"));
276 wprintf("</A></li>\n");
279 if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
281 "<a href=\"display_aide_menu\" "
284 _("Room and system administration functions")
286 if (ib_displayas != IB_TEXTONLY) {
287 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
288 "src=\"static/advanpage2_32x.gif\">");
290 if (ib_displayas != IB_PICONLY) {
291 wprintf(_("Administration"));
293 wprintf("</A></li>\n");
297 "<a href=\"termquit\" TITLE=\"%s\" "
298 "onClick=\"return confirm('%s');\">",
303 if (ib_displayas != IB_TEXTONLY) {
304 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
305 "src=\"static/logoff_32x.gif\">");
307 if (ib_displayas != IB_PICONLY) {
308 wprintf(_("Log off"));
310 wprintf("</A></li>\n");
313 "<li><div align=\"center\">"
314 "<a href=\"display_customize_iconbar\" "
318 _("Customize this menu"),
319 _("customize this menu")
322 wprintf("</ul></div>\n");
327 * If the user has toggled the icon bar over to a room list, here's where
328 * we generate its innerHTML...
330 void do_iconbar_roomlist(void) {
333 char key[SIZ], value[SIZ];
336 WC->current_iconbar = current_iconbar_roomlist;
338 /* The initialized values of these variables also happen to
339 * specify the default values for users who haven't customized
340 * their iconbars. These should probably be set in a master
341 * configuration somewhere.
343 int ib_displayas = 0; /* pictures and text, pictures, text */
344 int ib_logo = 0; /* Site logo */
345 int ib_citadel = 1; /* 'Powered by Citadel' logo */
349 get_preference("iconbar", iconbar, sizeof iconbar);
350 for (i=0; i<num_tokens(iconbar, ','); ++i) {
351 extract_token(buf, iconbar, i, ',', sizeof buf);
352 extract_token(key, buf, 0, '=', sizeof key);
353 extract_token(value, buf, 1, '=', sizeof value);
355 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
356 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
357 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
360 wprintf("<div id=\"button\">\n"
366 if (ib_displayas != IB_TEXTONLY) {
367 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" "
368 "HEIGHT=\"32\" src=\"image&name=hello\" ALT=\" \">\n"
374 if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
375 "<li><div align=\"center\">"
376 "<a href=\"http://www.citadel.org\" "
377 "title=\"%s\" target=\"aboutcit\">"
379 "src=\"static/citadel-logo.gif\" ALT=\"%s\"></a>"
381 _("Find out more about Citadel"),
385 wprintf("<li><div align=\"center\"><a href=\"javascript:switch_to_menu_buttons()\">");
386 wprintf(_("switch to menu"));
387 wprintf("</a></div>");
390 "<a href=\"termquit\" TITLE=\"%s\" "
391 "onClick=\"return confirm('%s');\">",
396 if (ib_displayas != IB_TEXTONLY) {
397 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
398 "src=\"static/logoff_32x.gif\">");
400 if (ib_displayas != IB_PICONLY) {
401 wprintf(_("Log off"));
403 wprintf("</A></li>\n");
405 wprintf("</ul></div>\n");
407 /* embed the room list */
408 list_all_rooms_by_floor("iconbar");
415 void display_customize_iconbar(void) {
418 char key[SIZ], value[SIZ];
422 /* The initialized values of these variables also happen to
423 * specify the default values for users who haven't customized
424 * their iconbars. These should probably be set in a master
425 * configuration somewhere.
427 int ib_displayas = IB_PICTEXT; /* pictures and text, pictures, text */
428 int ib_logo = 0; /* Site logo */
429 int ib_summary = 1; /* Summary page icon */
430 int ib_inbox = 1; /* Inbox icon */
431 int ib_calendar = 1; /* Calendar icon */
432 int ib_contacts = 1; /* Contacts icon */
433 int ib_notes = 1; /* Notes icon */
434 int ib_tasks = 1; /* Tasks icon */
435 int ib_rooms = 1; /* Rooms icon */
436 int ib_users = 1; /* Users icon */
437 int ib_chat = 1; /* Chat icon */
438 int ib_advanced = 1; /* Advanced Options icon */
439 int ib_citadel = 1; /* 'Powered by Citadel' logo */
443 get_preference("iconbar", iconbar, sizeof iconbar);
444 for (i=0; i<num_tokens(iconbar, ','); ++i) {
445 extract_token(buf, iconbar, i, ',', sizeof buf);
446 extract_token(key, buf, 0, '=', sizeof key);
447 extract_token(value, buf, 1, '=', sizeof value);
449 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
450 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
451 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
452 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
453 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
454 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
455 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
456 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
457 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
458 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
459 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
460 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
461 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
464 output_headers(1, 1, 2, 0, 0, 0);
465 wprintf("<div id=\"banner\">\n"
466 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
467 "<SPAN CLASS=\"titlebar\">");
468 wprintf(_("Customize the icon bar"));
470 "</TD></TR></TABLE>\n"
471 "</div>\n<div id=\"content\">\n"
474 wprintf("<div class=\"fix_scrollbar_bug\">"
475 "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>");
477 wprintf("<FORM METHOD=\"POST\" action=\"commit_iconbar\">\n");
480 wprintf(_("Display icons as:"));
482 for (i=0; i<=2; ++i) {
483 wprintf("<INPUT TYPE=\"radio\" NAME=\"ib_displayas\" VALUE=\"%d\"", i);
484 if (ib_displayas == i) wprintf(" CHECKED");
486 if (i == IB_PICTEXT) wprintf(_("pictures and text"));
487 if (i == IB_PICONLY) wprintf(_("pictures only"));
488 if (i == IB_TEXTONLY) wprintf(_("text only"));
491 wprintf("<br /><br />\n");
493 wprintf(_("Select the icons you would like to see displayed "
494 "in the 'icon bar' menu on the left side of the "
496 wprintf("</CENTER><br />\n");
498 wprintf("<TABLE border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
500 wprintf("<TR BGCOLOR=%s><TD>"
501 "<INPUT TYPE=\"checkbox\" NAME=\"ib_logo\" VALUE=\"yes\" %s>"
503 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
504 "src=\"image&name=hello\" ALT=\" \">"
509 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
510 (ib_logo ? "CHECKED" : ""),
512 _("An icon describing this site")
515 wprintf("<TR bgcolor=%s><TD>"
516 "<INPUT TYPE=\"checkbox\" NAME=\"ib_summary\" VALUE=\"yes\" %s>"
518 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
519 "src=\"static/summscreen_48x.gif\" ALT=\" \">"
524 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
525 (ib_summary ? "CHECKED" : ""),
527 _("Your summary page")
530 wprintf("<TR bgcolor=%s><TD>"
531 "<INPUT TYPE=\"checkbox\" NAME=\"ib_inbox\" VALUE=\"yes\" %s>"
533 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
534 "src=\"static/privatemess_48x.gif\" ALT=\" \">"
539 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
540 (ib_inbox ? "CHECKED" : ""),
542 _("A shortcut to your email Inbox")
545 wprintf("<TR bgcolor=%s><TD>"
546 "<INPUT TYPE=\"checkbox\" NAME=\"ib_contacts\" "
549 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
550 "src=\"static/viewcontacts_48x.gif\" ALT=\" \">"
555 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
556 (ib_contacts ? "CHECKED" : ""),
558 _("Your personal address book")
561 wprintf("<TR bgcolor=%s><TD>"
562 "<INPUT TYPE=\"checkbox\" NAME=\"ib_notes\" "
565 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
566 "src=\"static/storenotes_48x.gif\" ALT=\" \">"
571 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
572 (ib_notes ? "CHECKED" : ""),
574 _("Your personal notes")
577 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
578 wprintf("<TR bgcolor=%s><TD>"
579 "<INPUT TYPE=\"checkbox\" NAME=\"ib_calendar\" "
582 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
583 "src=\"static/calarea_48x.gif\" ALT=\" \">"
588 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
589 (ib_calendar ? "CHECKED" : ""),
591 _("A shortcut to your personal calendar")
594 wprintf("<TR bgcolor=%s><TD>"
595 "<INPUT TYPE=\"checkbox\" NAME=\"ib_tasks\" VALUE=\"yes\" %s>"
597 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
598 "src=\"static/taskmanag_48x.gif\" ALT=\" \">"
603 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
604 (ib_tasks ? "CHECKED" : ""),
606 _("A shortcut to your personal task list")
608 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
610 wprintf("<TR bgcolor=%s><TD>"
611 "<INPUT TYPE=\"checkbox\" NAME=\"ib_rooms\" VALUE=\"yes\" %s>"
613 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
614 "src=\"static/chatrooms_48x.gif\" ALT=\" \">"
619 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
620 (ib_rooms ? "CHECKED" : ""),
622 _("Clicking this icon displays a list of all accesible "
623 "rooms (or folders) available.")
626 wprintf("<TR bgcolor=%s><TD>"
627 "<INPUT TYPE=\"checkbox\" NAME=\"ib_users\" VALUE=\"yes\" %s>"
629 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
630 "src=\"static/usermanag_48x.gif\" ALT=\" \">"
635 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
636 (ib_users ? "CHECKED" : ""),
638 _("Clicking this icon displays a list of all users "
639 "currently logged in.")
642 wprintf("<TR bgcolor=%s><TD>"
643 "<INPUT TYPE=\"checkbox\" NAME=\"ib_chat\" VALUE=\"yes\" %s>"
645 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
646 "src=\"static/citadelchat_48x.gif\" ALT=\" \">"
651 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
652 (ib_chat ? "CHECKED" : ""),
654 _("Clicking this icon enters real-time chat mode "
655 "with other users in the same room.")
659 wprintf("<TR bgcolor=%s><TD>"
660 "<INPUT TYPE=\"checkbox\" NAME=\"ib_advanced\" "
663 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
664 "src=\"static/advanpage2_48x.gif\" ALT=\" \">"
669 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
670 (ib_advanced ? "CHECKED" : ""),
671 _("Advanced options"),
672 _("Access to the complete menu of Citadel functions.")
676 wprintf("<TR bgcolor=%s><TD>"
677 "<INPUT TYPE=\"checkbox\" NAME=\"ib_citadel\" "
680 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
681 "src=\"static/citadel-logo.gif\" ALT=\" \">"
686 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
687 (ib_citadel ? "CHECKED" : ""),
689 _("Displays the 'Powered by Citadel' icon")
692 wprintf("</TABLE><br />\n"
694 "<INPUT TYPE=\"submit\" NAME=\"ok_button\" VALUE=\"%s\">"
696 "<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">"
697 "</CENTER></FORM>\n",
702 wprintf("</td></tr></table></div>\n");
707 void commit_iconbar(void) {
727 if (strlen(bstr("ok_button")) == 0) {
732 sprintf(iconbar, "ib_displayas=%d", atoi(bstr("ib_displayas")));
734 for (i=0; i<(sizeof(boxen)/sizeof(char *)); ++i) {
735 sprintf(&iconbar[strlen(iconbar)], ",%s=", boxen[i]);
736 if (!strcasecmp(bstr(boxen[i]), "yes")) {
737 sprintf(&iconbar[strlen(iconbar)], "1");
740 sprintf(&iconbar[strlen(iconbar)], "0");
744 set_preference("iconbar", iconbar, 1);
746 output_headers(1, 1, 0, 0, 0, 0);
748 "<center><table border=1 bgcolor=\"#ffffff\"><tr><td>"
749 "<img src=\"static/advanpage2_48x.gif\">"
751 wprintf(_("Your icon bar has been updated. Please select any of its "
752 "choices to continue."));
753 wprintf("</td></tr></table>\n");