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")
313 wprintf("<div id=\"dropstuff\" style=\"font-size:6pt\">");
314 wprintf("Drag to trash here...<br>");
323 * If the user has toggled the icon bar over to a room list, here's where
324 * we generate its innerHTML...
326 void do_iconbar_roomlist(void) {
329 char key[SIZ], value[SIZ];
332 /* The initialized values of these variables also happen to
333 * specify the default values for users who haven't customized
334 * their iconbars. These should probably be set in a master
335 * configuration somewhere.
337 int ib_displayas = 0; /* pictures and text, pictures, text */
338 int ib_logo = 0; /* Site logo */
339 int ib_citadel = 1; /* 'Powered by Citadel' logo */
343 get_preference("iconbar", iconbar, sizeof iconbar);
344 for (i=0; i<num_tokens(iconbar, ','); ++i) {
345 extract_token(buf, iconbar, i, ',', sizeof buf);
346 extract_token(key, buf, 0, '=', sizeof key);
347 extract_token(value, buf, 1, '=', sizeof value);
349 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
350 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
351 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
354 wprintf("<div id=\"button\">\n"
360 if (ib_displayas != IB_TEXTONLY) {
361 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" "
362 "HEIGHT=\"32\" src=\"image&name=hello\" ALT=\" \">\n"
368 if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
369 "<li><div align=\"center\">"
370 "<a href=\"http://www.citadel.org\" "
371 "title=\"%s\" target=\"aboutcit\">"
373 "src=\"static/citadel-logo.gif\" ALT=\"%s\"></a>"
375 _("Find out more about Citadel"),
379 wprintf("<li><a href=\"javascript:switch_to_menu_buttons()\">back to menu...</a>");
383 /* embed the room list */
384 list_all_rooms_by_floor("iconbar");
387 wprintf("<div id=\"dropstuff\" style=\"font-size:6pt\">");
388 wprintf("Drag to trash here...<br>");
397 void display_customize_iconbar(void) {
400 char key[SIZ], value[SIZ];
404 /* The initialized values of these variables also happen to
405 * specify the default values for users who haven't customized
406 * their iconbars. These should probably be set in a master
407 * configuration somewhere.
409 int ib_displayas = IB_PICTEXT; /* pictures and text, pictures, text */
410 int ib_logo = 0; /* Site logo */
411 int ib_summary = 1; /* Summary page icon */
412 int ib_inbox = 1; /* Inbox icon */
413 int ib_calendar = 1; /* Calendar icon */
414 int ib_contacts = 1; /* Contacts icon */
415 int ib_notes = 1; /* Notes icon */
416 int ib_tasks = 1; /* Tasks icon */
417 int ib_rooms = 1; /* Rooms icon */
418 int ib_users = 1; /* Users icon */
419 int ib_chat = 1; /* Chat icon */
420 int ib_advanced = 1; /* Advanced Options icon */
421 int ib_citadel = 1; /* 'Powered by Citadel' logo */
425 get_preference("iconbar", iconbar, sizeof iconbar);
426 for (i=0; i<num_tokens(iconbar, ','); ++i) {
427 extract_token(buf, iconbar, i, ',', sizeof buf);
428 extract_token(key, buf, 0, '=', sizeof key);
429 extract_token(value, buf, 1, '=', sizeof value);
431 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
432 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
433 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
434 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
435 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
436 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
437 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
438 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
439 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
440 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
441 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
442 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
443 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
446 output_headers(1, 1, 2, 0, 0, 0);
447 wprintf("<div id=\"banner\">\n"
448 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
449 "<SPAN CLASS=\"titlebar\">");
450 wprintf(_("Customize the icon bar"));
452 "</TD></TR></TABLE>\n"
453 "</div>\n<div id=\"content\">\n"
456 wprintf("<div id=\"fix_scrollbar_bug\">"
457 "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>");
459 wprintf("<FORM METHOD=\"POST\" action=\"commit_iconbar\">\n");
462 wprintf(_("Display icons as:"));
464 for (i=0; i<=2; ++i) {
465 wprintf("<INPUT TYPE=\"radio\" NAME=\"ib_displayas\" VALUE=\"%d\"", i);
466 if (ib_displayas == i) wprintf(" CHECKED");
468 if (i == IB_PICTEXT) wprintf(_("pictures and text"));
469 if (i == IB_PICONLY) wprintf(_("pictures only"));
470 if (i == IB_TEXTONLY) wprintf(_("text only"));
473 wprintf("<br /><br />\n");
475 wprintf(_("Select the icons you would like to see displayed "
476 "in the 'icon bar' menu on the left side of the "
478 wprintf("</CENTER><br />\n");
480 wprintf("<TABLE border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
482 wprintf("<TR BGCOLOR=%s><TD>"
483 "<INPUT TYPE=\"checkbox\" NAME=\"ib_logo\" VALUE=\"yes\" %s>"
485 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
486 "src=\"image&name=hello\" ALT=\" \">"
491 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
492 (ib_logo ? "CHECKED" : ""),
494 _("An icon describing this site")
497 wprintf("<TR bgcolor=%s><TD>"
498 "<INPUT TYPE=\"checkbox\" NAME=\"ib_summary\" VALUE=\"yes\" %s>"
500 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
501 "src=\"static/summscreen_48x.gif\" ALT=\" \">"
506 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
507 (ib_summary ? "CHECKED" : ""),
509 _("Your summary page")
512 wprintf("<TR bgcolor=%s><TD>"
513 "<INPUT TYPE=\"checkbox\" NAME=\"ib_inbox\" VALUE=\"yes\" %s>"
515 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
516 "src=\"static/privatemess_48x.gif\" ALT=\" \">"
521 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
522 (ib_inbox ? "CHECKED" : ""),
524 _("A shortcut to your email Inbox")
527 wprintf("<TR bgcolor=%s><TD>"
528 "<INPUT TYPE=\"checkbox\" NAME=\"ib_contacts\" "
531 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
532 "src=\"static/viewcontacts_48x.gif\" ALT=\" \">"
537 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
538 (ib_contacts ? "CHECKED" : ""),
540 _("Your personal address book")
543 wprintf("<TR bgcolor=%s><TD>"
544 "<INPUT TYPE=\"checkbox\" NAME=\"ib_notes\" "
547 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
548 "src=\"static/storenotes_48x.gif\" ALT=\" \">"
553 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
554 (ib_notes ? "CHECKED" : ""),
556 _("Your personal notes")
559 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
560 wprintf("<TR bgcolor=%s><TD>"
561 "<INPUT TYPE=\"checkbox\" NAME=\"ib_calendar\" "
564 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
565 "src=\"static/calarea_48x.gif\" ALT=\" \">"
570 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
571 (ib_calendar ? "CHECKED" : ""),
573 _("A shortcut to your personal calendar")
576 wprintf("<TR bgcolor=%s><TD>"
577 "<INPUT TYPE=\"checkbox\" NAME=\"ib_tasks\" VALUE=\"yes\" %s>"
579 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
580 "src=\"static/taskmanag_48x.gif\" ALT=\" \">"
585 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
586 (ib_tasks ? "CHECKED" : ""),
588 _("A shortcut to your personal task list")
590 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
592 wprintf("<TR bgcolor=%s><TD>"
593 "<INPUT TYPE=\"checkbox\" NAME=\"ib_rooms\" VALUE=\"yes\" %s>"
595 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
596 "src=\"static/chatrooms_48x.gif\" ALT=\" \">"
601 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
602 (ib_rooms ? "CHECKED" : ""),
604 _("Clicking this icon displays a list of all accesible "
605 "rooms (or folders) available.")
608 wprintf("<TR bgcolor=%s><TD>"
609 "<INPUT TYPE=\"checkbox\" NAME=\"ib_users\" VALUE=\"yes\" %s>"
611 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
612 "src=\"static/usermanag_48x.gif\" ALT=\" \">"
617 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
618 (ib_users ? "CHECKED" : ""),
620 _("Clicking this icon displays a list of all users "
621 "currently logged in.")
624 wprintf("<TR bgcolor=%s><TD>"
625 "<INPUT TYPE=\"checkbox\" NAME=\"ib_chat\" VALUE=\"yes\" %s>"
627 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
628 "src=\"static/citadelchat_48x.gif\" ALT=\" \">"
633 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
634 (ib_chat ? "CHECKED" : ""),
636 _("Clicking this icon enters real-time chat mode "
637 "with other users in the same room.")
641 wprintf("<TR bgcolor=%s><TD>"
642 "<INPUT TYPE=\"checkbox\" NAME=\"ib_advanced\" "
645 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
646 "src=\"static/advanpage2_48x.gif\" ALT=\" \">"
651 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
652 (ib_advanced ? "CHECKED" : ""),
653 _("Advanced options"),
654 _("Access to the complete menu of Citadel functions.")
658 wprintf("<TR bgcolor=%s><TD>"
659 "<INPUT TYPE=\"checkbox\" NAME=\"ib_citadel\" "
662 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
663 "src=\"static/citadel-logo.gif\" ALT=\" \">"
668 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
669 (ib_citadel ? "CHECKED" : ""),
671 _("Displays the 'Powered by Citadel' icon")
674 wprintf("</TABLE><br />\n"
676 "<INPUT TYPE=\"submit\" NAME=\"ok_button\" VALUE=\"%s\">"
678 "<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">"
679 "</CENTER></FORM>\n",
684 wprintf("</td></tr></table></div>\n");
689 void commit_iconbar(void) {
709 if (strlen(bstr("ok_button")) == 0) {
714 sprintf(iconbar, "ib_displayas=%d", atoi(bstr("ib_displayas")));
716 for (i=0; i<(sizeof(boxen)/sizeof(char *)); ++i) {
717 sprintf(&iconbar[strlen(iconbar)], ",%s=", boxen[i]);
718 if (!strcasecmp(bstr(boxen[i]), "yes")) {
719 sprintf(&iconbar[strlen(iconbar)], "1");
722 sprintf(&iconbar[strlen(iconbar)], "0");
726 set_preference("iconbar", iconbar, 1);
728 output_headers(1, 1, 0, 0, 0, 0);
730 "<center><table border=1 bgcolor=\"#ffffff\"><tr><td>"
731 "<img src=\"static/advanpage2_48x.gif\">"
733 wprintf(_("Your icon bar has been updated. Please select any of its "
734 "choices to continue."));
735 wprintf("</td></tr></table>\n");