5 * \defgroup IconBar Displays and customizes the iconbar.
11 /** Values for ib_displayas */
12 #define IB_PICTEXT 0 /**< picture and text */
13 #define IB_PICONLY 1 /**< just a picture */
14 #define IB_TEXTONLY 2 /**< just text */
18 * \brief draw the icon bar?????
20 void do_selected_iconbar(void) {
21 if (WC->current_iconbar == current_iconbar_roomlist) {
22 do_iconbar_roomlist();
30 * \brief draw the icon bar???
32 void do_iconbar(void) {
35 char key[SIZ], value[SIZ];
38 WC->current_iconbar = current_iconbar_menu;
41 * The initialized values of these variables also happen to
42 * specify the default values for users who haven't customized
43 * their iconbars. These should probably be set in a master
44 * configuration somewhere.
46 int ib_displayas = 0; /**< pictures and text, pictures, text */
47 int ib_logo = 0; /**< Site logo */
48 int ib_summary = 1; /**< Summary page icon */
49 int ib_inbox = 1; /**< Inbox icon */
50 int ib_calendar = 1; /**< Calendar icon */
51 int ib_contacts = 1; /**< Contacts icon */
52 int ib_notes = 1; /**< Notes icon */
53 int ib_tasks = 1; /**< Tasks icon */
54 int ib_rooms = 1; /**< Rooms icon */
55 int ib_users = 1; /**< Users icon */
56 int ib_chat = 1; /**< Chat icon */
57 int ib_advanced = 1; /**< Advanced Options icon */
58 int ib_citadel = 1; /**< 'Powered by Citadel' logo */
62 get_preference("iconbar", iconbar, sizeof iconbar);
63 for (i=0; i<num_tokens(iconbar, ','); ++i) {
64 extract_token(buf, iconbar, i, ',', sizeof buf);
65 extract_token(key, buf, 0, '=', sizeof key);
66 extract_token(value, buf, 1, '=', sizeof value);
68 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
69 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
70 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
71 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
72 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
73 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
74 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
75 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
76 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
77 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
78 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
79 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
80 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
83 wprintf("<div id=\"button\">\n"
89 if (ib_displayas != IB_TEXTONLY) {
90 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" "
91 "HEIGHT=\"32\" src=\"image&name=hello\" ALT=\" \">\n"
97 if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
98 "<li><div align=\"center\">"
99 "<a href=\"http://www.citadel.org\" "
100 "title=\"%s\" target=\"aboutcit\">"
102 "src=\"static/citadel-logo.gif\" ALT=\"%s\"></a>"
104 _("Find out more about Citadel"),
108 wprintf("<li><div align=\"center\"><a href=\"javascript:switch_to_room_list()\">");
109 wprintf(_("switch to room list"));
110 wprintf("</a></div>");
113 wprintf("<li><a href=\"summary\" "
115 ">", _("Your summary page")
117 if (ib_displayas != IB_TEXTONLY) {
118 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
119 "src=\"static/summscreen_32x.gif\">");
121 if (ib_displayas != IB_PICONLY) {
122 wprintf(_("Summary"));
124 wprintf("</A></li>\n");
129 "<a href=\"dotgoto?room=_MAIL_\" "
132 _("Go to your email inbox")
134 if (ib_displayas != IB_TEXTONLY) {
135 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
136 "src=\"static/privatemess_32x.gif\">");
138 if (ib_displayas != IB_PICONLY) {
140 if (WC->new_mail != WC->remember_new_mail) {
142 if (WC->new_mail > 0) {
143 wprintf(" <b>(%d)</b>", WC->new_mail);
146 WC->remember_new_mail = WC->new_mail;
149 wprintf("</A></li>\n");
154 "<a href=\"dotgoto?room=_CALENDAR_\" "
157 _("Go to your personal calendar")
159 if (ib_displayas != IB_TEXTONLY) {
160 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
161 "src=\"static/calarea_32x.gif\">");
163 if (ib_displayas != IB_PICONLY) {
164 wprintf(_("Calendar"));
166 wprintf("</A></li>\n");
171 "<a href=\"dotgoto?room=_CONTACTS_\" "
174 _("Go to your personal address book")
176 if (ib_displayas != IB_TEXTONLY) {
177 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
178 "src=\"static/viewcontacts_32x.gif\">");
180 if (ib_displayas != IB_PICONLY) {
181 wprintf(_("Contacts"));
183 wprintf("</A></li>\n");
188 "<a href=\"dotgoto?room=_NOTES_\" "
191 _("Go to your personal notes")
193 if (ib_displayas != IB_TEXTONLY) {
194 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
195 "src=\"static/storenotes_32x.gif\">");
197 if (ib_displayas != IB_PICONLY) {
200 wprintf("</A></li>\n");
205 "<a href=\"dotgoto?room=_TASKS_\" "
208 _("Go to your personal task list")
210 if (ib_displayas != IB_TEXTONLY) {
211 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
212 "src=\"static/taskmanag_32x.gif\">");
214 if (ib_displayas != IB_PICONLY) {
217 wprintf("</A></li>\n");
222 "<a href=\"knrooms\" TITLE=\"%s\" >",
223 _("List all of your accessible rooms")
225 if (ib_displayas != IB_TEXTONLY) {
226 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
227 "src=\"static/chatrooms_32x.gif\">");
229 if (ib_displayas != IB_PICONLY) {
232 wprintf("</A></li>\n");
237 "<a href=\"who\" TITLE=\"%s\" "
239 _("See who is online right now")
241 if (ib_displayas != IB_TEXTONLY) {
242 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
243 "src=\"static/usermanag_32x.gif\">");
245 if (ib_displayas != IB_PICONLY) {
246 wprintf(_("Who is online?"));
248 wprintf("</A></li>\n");
253 "<a href=\"#\" onClick=\"window.open('chat', "
254 "'ctdl_chat_window', "
255 "'toolbar=no,location=no,directories=no,copyhistory=no,"
256 "status=no,scrollbars=yes,resizable=yes');\""
259 if (ib_displayas != IB_TEXTONLY) {
260 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
261 "src=\"static/citadelchat_32x.gif\">");
263 if (ib_displayas != IB_PICONLY) {
266 wprintf("</A></li>\n");
271 "<a href=\"display_main_menu\" "
274 _("Advanced Options Menu: Advanced Room commands, Account Info, and Chat")
276 if (ib_displayas != IB_TEXTONLY) {
277 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
278 "src=\"static/advanpage2_32x.gif\">");
280 if (ib_displayas != IB_PICONLY) {
281 wprintf(_("Advanced"));
283 wprintf("</A></li>\n");
286 if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
288 "<a href=\"display_aide_menu\" "
291 _("Room and system administration functions")
293 if (ib_displayas != IB_TEXTONLY) {
294 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
295 "src=\"static/advanpage2_32x.gif\">");
297 if (ib_displayas != IB_PICONLY) {
298 wprintf(_("Administration"));
300 wprintf("</A></li>\n");
304 "<a href=\"termquit\" TITLE=\"%s\" "
305 "onClick=\"return confirm('%s');\">",
310 if (ib_displayas != IB_TEXTONLY) {
311 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
312 "src=\"static/logoff_32x.gif\">");
314 if (ib_displayas != IB_PICONLY) {
315 wprintf(_("Log off"));
317 wprintf("</A></li>\n");
320 "<li><div align=\"center\">"
321 "<a href=\"display_customize_iconbar\" "
325 _("Customize this menu"),
326 _("customize this menu")
329 wprintf("</ul></div>\n");
334 * \brief roomtree view of the iconbar
335 * If the user has toggled the icon bar over to a room list, here's where
336 * we generate its innerHTML...
338 void do_iconbar_roomlist(void) {
341 char key[SIZ], value[SIZ];
344 WC->current_iconbar = current_iconbar_roomlist;
347 * The initialized values of these variables also happen to
348 * specify the default values for users who haven't customized
349 * their iconbars. These should probably be set in a master
350 * configuration somewhere.
352 int ib_displayas = 0; /* pictures and text, pictures, text */
353 int ib_logo = 0; /* Site logo */
354 int ib_citadel = 1; /* 'Powered by Citadel' logo */
358 get_preference("iconbar", iconbar, sizeof iconbar);
359 for (i=0; i<num_tokens(iconbar, ','); ++i) {
360 extract_token(buf, iconbar, i, ',', sizeof buf);
361 extract_token(key, buf, 0, '=', sizeof key);
362 extract_token(value, buf, 1, '=', sizeof value);
364 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
365 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
366 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
369 wprintf("<div id=\"button\">\n"
375 if (ib_displayas != IB_TEXTONLY) {
376 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" "
377 "HEIGHT=\"32\" src=\"image&name=hello\" ALT=\" \">\n"
383 if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
384 "<li><div align=\"center\">"
385 "<a href=\"http://www.citadel.org\" "
386 "title=\"%s\" target=\"aboutcit\">"
388 "src=\"static/citadel-logo.gif\" ALT=\"%s\"></a>"
390 _("Find out more about Citadel"),
394 wprintf("<li><div align=\"center\"><a href=\"javascript:switch_to_menu_buttons()\">");
395 wprintf(_("switch to menu"));
396 wprintf("</a></div>");
399 "<a href=\"termquit\" TITLE=\"%s\" "
400 "onClick=\"return confirm('%s');\">",
405 if (ib_displayas != IB_TEXTONLY) {
406 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
407 "src=\"static/logoff_32x.gif\">");
409 if (ib_displayas != IB_PICONLY) {
410 wprintf(_("Log off"));
412 wprintf("</A></li>\n");
414 wprintf("</ul></div>\n");
416 /** embed the room list */
417 list_all_rooms_by_floor("iconbar");
424 * \brief display a customized version of the iconbar
426 void display_customize_iconbar(void) {
429 char key[SIZ], value[SIZ];
434 * The initialized values of these variables also happen to
435 * specify the default values for users who haven't customized
436 * their iconbars. These should probably be set in a master
437 * configuration somewhere.
439 int ib_displayas = IB_PICTEXT; /**< pictures and text, pictures, text */
440 int ib_logo = 0; /**< Site logo */
441 int ib_summary = 1; /**< Summary page icon */
442 int ib_inbox = 1; /**< Inbox icon */
443 int ib_calendar = 1; /**< Calendar icon */
444 int ib_contacts = 1; /**< Contacts icon */
445 int ib_notes = 1; /**< Notes icon */
446 int ib_tasks = 1; /**< Tasks icon */
447 int ib_rooms = 1; /**< Rooms icon */
448 int ib_users = 1; /**< Users icon */
449 int ib_chat = 1; /**< Chat icon */
450 int ib_advanced = 1; /**< Advanced Options icon */
451 int ib_citadel = 1; /**< 'Powered by Citadel' logo */
455 get_preference("iconbar", iconbar, sizeof iconbar);
456 for (i=0; i<num_tokens(iconbar, ','); ++i) {
457 extract_token(buf, iconbar, i, ',', sizeof buf);
458 extract_token(key, buf, 0, '=', sizeof key);
459 extract_token(value, buf, 1, '=', sizeof value);
461 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
462 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
463 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
464 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
465 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
466 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
467 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
468 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
469 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
470 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
471 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
472 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
473 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
476 output_headers(1, 1, 2, 0, 0, 0);
477 wprintf("<div id=\"banner\">\n"
478 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
479 "<SPAN CLASS=\"titlebar\">");
480 wprintf(_("Customize the icon bar"));
482 "</TD></TR></TABLE>\n"
483 "</div>\n<div id=\"content\">\n"
486 wprintf("<div class=\"fix_scrollbar_bug\">"
487 "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>");
489 wprintf("<FORM METHOD=\"POST\" action=\"commit_iconbar\">\n");
492 wprintf(_("Display icons as:"));
494 for (i=0; i<=2; ++i) {
495 wprintf("<INPUT TYPE=\"radio\" NAME=\"ib_displayas\" VALUE=\"%d\"", i);
496 if (ib_displayas == i) wprintf(" CHECKED");
498 if (i == IB_PICTEXT) wprintf(_("pictures and text"));
499 if (i == IB_PICONLY) wprintf(_("pictures only"));
500 if (i == IB_TEXTONLY) wprintf(_("text only"));
503 wprintf("<br /><br />\n");
505 wprintf(_("Select the icons you would like to see displayed "
506 "in the 'icon bar' menu on the left side of the "
508 wprintf("</CENTER><br />\n");
510 wprintf("<TABLE border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
512 wprintf("<TR BGCOLOR=%s><TD>"
513 "<INPUT TYPE=\"checkbox\" NAME=\"ib_logo\" VALUE=\"yes\" %s>"
515 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
516 "src=\"image&name=hello\" ALT=\" \">"
521 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
522 (ib_logo ? "CHECKED" : ""),
524 _("An icon describing this site")
527 wprintf("<TR bgcolor=%s><TD>"
528 "<INPUT TYPE=\"checkbox\" NAME=\"ib_summary\" VALUE=\"yes\" %s>"
530 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
531 "src=\"static/summscreen_48x.gif\" ALT=\" \">"
536 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
537 (ib_summary ? "CHECKED" : ""),
539 _("Your summary page")
542 wprintf("<TR bgcolor=%s><TD>"
543 "<INPUT TYPE=\"checkbox\" NAME=\"ib_inbox\" VALUE=\"yes\" %s>"
545 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
546 "src=\"static/privatemess_48x.gif\" ALT=\" \">"
551 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
552 (ib_inbox ? "CHECKED" : ""),
554 _("A shortcut to your email Inbox")
557 wprintf("<TR bgcolor=%s><TD>"
558 "<INPUT TYPE=\"checkbox\" NAME=\"ib_contacts\" "
561 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
562 "src=\"static/viewcontacts_48x.gif\" ALT=\" \">"
567 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
568 (ib_contacts ? "CHECKED" : ""),
570 _("Your personal address book")
573 wprintf("<TR bgcolor=%s><TD>"
574 "<INPUT TYPE=\"checkbox\" NAME=\"ib_notes\" "
577 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
578 "src=\"static/storenotes_48x.gif\" ALT=\" \">"
583 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
584 (ib_notes ? "CHECKED" : ""),
586 _("Your personal notes")
589 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
590 wprintf("<TR bgcolor=%s><TD>"
591 "<INPUT TYPE=\"checkbox\" NAME=\"ib_calendar\" "
594 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
595 "src=\"static/calarea_48x.gif\" ALT=\" \">"
600 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
601 (ib_calendar ? "CHECKED" : ""),
603 _("A shortcut to your personal calendar")
606 wprintf("<TR bgcolor=%s><TD>"
607 "<INPUT TYPE=\"checkbox\" NAME=\"ib_tasks\" VALUE=\"yes\" %s>"
609 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
610 "src=\"static/taskmanag_48x.gif\" ALT=\" \">"
615 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
616 (ib_tasks ? "CHECKED" : ""),
618 _("A shortcut to your personal task list")
620 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
622 wprintf("<TR bgcolor=%s><TD>"
623 "<INPUT TYPE=\"checkbox\" NAME=\"ib_rooms\" VALUE=\"yes\" %s>"
625 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
626 "src=\"static/chatrooms_48x.gif\" ALT=\" \">"
631 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
632 (ib_rooms ? "CHECKED" : ""),
634 _("Clicking this icon displays a list of all accessible "
635 "rooms (or folders) available.")
638 wprintf("<TR bgcolor=%s><TD>"
639 "<INPUT TYPE=\"checkbox\" NAME=\"ib_users\" VALUE=\"yes\" %s>"
641 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
642 "src=\"static/usermanag_48x.gif\" ALT=\" \">"
647 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
648 (ib_users ? "CHECKED" : ""),
650 _("Clicking this icon displays a list of all users "
651 "currently logged in.")
654 wprintf("<TR bgcolor=%s><TD>"
655 "<INPUT TYPE=\"checkbox\" NAME=\"ib_chat\" VALUE=\"yes\" %s>"
657 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
658 "src=\"static/citadelchat_48x.gif\" ALT=\" \">"
663 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
664 (ib_chat ? "CHECKED" : ""),
666 _("Clicking this icon enters real-time chat mode "
667 "with other users in the same room.")
671 wprintf("<TR bgcolor=%s><TD>"
672 "<INPUT TYPE=\"checkbox\" NAME=\"ib_advanced\" "
675 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
676 "src=\"static/advanpage2_48x.gif\" ALT=\" \">"
681 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
682 (ib_advanced ? "CHECKED" : ""),
683 _("Advanced options"),
684 _("Access to the complete menu of Citadel functions.")
688 wprintf("<TR bgcolor=%s><TD>"
689 "<INPUT TYPE=\"checkbox\" NAME=\"ib_citadel\" "
692 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
693 "src=\"static/citadel-logo.gif\" ALT=\" \">"
698 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
699 (ib_citadel ? "CHECKED" : ""),
701 _("Displays the 'Powered by Citadel' icon")
704 wprintf("</TABLE><br />\n"
706 "<INPUT TYPE=\"submit\" NAME=\"ok_button\" VALUE=\"%s\">"
708 "<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">"
709 "</CENTER></FORM>\n",
714 wprintf("</td></tr></table></div>\n");
719 * \brief commit the changes of an edited iconbar ????
721 void commit_iconbar(void) {
741 if (strlen(bstr("ok_button")) == 0) {
746 sprintf(iconbar, "ib_displayas=%d", atoi(bstr("ib_displayas")));
748 for (i=0; i<(sizeof(boxen)/sizeof(char *)); ++i) {
749 sprintf(&iconbar[strlen(iconbar)], ",%s=", boxen[i]);
750 if (!strcasecmp(bstr(boxen[i]), "yes")) {
751 sprintf(&iconbar[strlen(iconbar)], "1");
754 sprintf(&iconbar[strlen(iconbar)], "0");
758 set_preference("iconbar", iconbar, 1);
760 output_headers(1, 1, 0, 0, 0, 0);
762 "<center><table border=1 bgcolor=\"#ffffff\"><tr><td>"
763 "<img src=\"static/advanpage2_48x.gif\">"
765 wprintf(_("Your icon bar has been updated. Please select any of its "
766 "choices to continue."));
767 wprintf("</td></tr></table>\n");