4 * Displays and customizes the iconbar.
10 /* Values for ib_displayas */
15 void do_iconbar(void) {
18 char key[SIZ], value[SIZ];
21 /* The initialized values of these variables also happen to
22 * specify the default values for users who haven't customized
23 * their iconbars. These should probably be set in a master
24 * configuration somewhere.
26 int ib_displayas = 0; /* pictures and text, pictures, text */
27 int ib_logo = 0; /* Site logo */
28 int ib_summary = 1; /* Summary page icon */
29 int ib_inbox = 1; /* Inbox icon */
30 int ib_calendar = 1; /* Calendar icon */
31 int ib_contacts = 1; /* Contacts icon */
32 int ib_notes = 1; /* Notes icon */
33 int ib_tasks = 1; /* Tasks icon */
34 int ib_rooms = 1; /* Rooms icon */
35 int ib_users = 1; /* Users icon */
36 int ib_chat = 1; /* Chat icon */
37 int ib_advanced = 1; /* Advanced Options icon */
38 int ib_citadel = 1; /* 'Powered by Citadel' logo */
42 get_preference("iconbar", iconbar, sizeof iconbar);
43 for (i=0; i<num_tokens(iconbar, ','); ++i) {
44 extract_token(buf, iconbar, i, ',', sizeof buf);
45 extract_token(key, buf, 0, '=', sizeof key);
46 extract_token(value, buf, 1, '=', sizeof value);
48 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
49 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
50 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
51 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
52 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
53 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
54 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
55 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
56 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
57 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
58 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
59 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
60 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
63 wprintf("<div id=\"button\">\n"
69 if (ib_displayas != IB_TEXTONLY) {
70 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" "
71 "HEIGHT=\"32\" src=\"image&name=hello\" ALT=\" \">\n"
77 if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
78 "<li><div align=\"center\">"
79 "<a href=\"http://www.citadel.org\" "
80 "title=\"%s\" target=\"aboutcit\">"
82 "src=\"static/citadel-logo.gif\" ALT=\"%s\"></a>"
84 _("Find out more about Citadel"),
90 wprintf("<li><a href=\"summary\" "
92 ">", _("Your summary page")
94 if (ib_displayas != IB_TEXTONLY) {
95 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
96 "src=\"static/summscreen_32x.gif\">");
98 if (ib_displayas != IB_PICONLY) {
99 wprintf(_("Summary"));
101 wprintf("</A></li>\n");
106 "<a href=\"dotgoto?room=_MAIL_\" "
109 _("Go to your email inbox")
111 if (ib_displayas != IB_TEXTONLY) {
112 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
113 "src=\"static/privatemess_32x.gif\">");
115 if (ib_displayas != IB_PICONLY) {
117 if (WC->new_mail != WC->remember_new_mail) {
119 if (WC->new_mail > 0) {
120 wprintf(" <b>(%d)</b>", WC->new_mail);
123 WC->remember_new_mail = WC->new_mail;
126 wprintf("</A></li>\n");
131 "<a href=\"dotgoto?room=_CALENDAR_\" "
134 _("Go to your personal calendar")
136 if (ib_displayas != IB_TEXTONLY) {
137 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
138 "src=\"static/calarea_32x.gif\">");
140 if (ib_displayas != IB_PICONLY) {
141 wprintf(_("Calendar"));
143 wprintf("</A></li>\n");
148 "<a href=\"dotgoto?room=_CONTACTS_\" "
151 _("Go to your personal address book")
153 if (ib_displayas != IB_TEXTONLY) {
154 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
155 "src=\"static/viewcontacts_32x.gif\">");
157 if (ib_displayas != IB_PICONLY) {
158 wprintf(_("Contacts"));
160 wprintf("</A></li>\n");
165 "<a href=\"dotgoto?room=_NOTES_\" "
168 _("Go to your personal notes")
170 if (ib_displayas != IB_TEXTONLY) {
171 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
172 "src=\"static/storenotes_32x.gif\">");
174 if (ib_displayas != IB_PICONLY) {
177 wprintf("</A></li>\n");
182 "<a href=\"dotgoto?room=_TASKS_\" "
185 _("Go to your personal task list")
187 if (ib_displayas != IB_TEXTONLY) {
188 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
189 "src=\"static/taskmanag_32x.gif\">");
191 if (ib_displayas != IB_PICONLY) {
194 wprintf("</A></li>\n");
199 "<a href=\"knrooms\" TITLE=\"%s\" >",
200 _("List all of your accessible rooms")
202 if (ib_displayas != IB_TEXTONLY) {
203 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
204 "src=\"static/chatrooms_32x.gif\">");
206 if (ib_displayas != IB_PICONLY) {
209 wprintf("</A></li>\n");
214 "<a href=\"who\" TITLE=\"%s\" "
216 _("See who is online right now")
218 if (ib_displayas != IB_TEXTONLY) {
219 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
220 "src=\"static/usermanag_32x.gif\">");
222 if (ib_displayas != IB_PICONLY) {
223 wprintf(_("Who is online?"));
225 wprintf("</A></li>\n");
230 "<a href=\"#\" onClick=\"window.open('/chat', "
231 "'ctdl_chat_window', "
232 "'toolbar=no,location=no,directories=no,copyhistory=no,"
233 "status=no,scrollbars=yes,resizable=yes');\""
236 if (ib_displayas != IB_TEXTONLY) {
237 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
238 "src=\"static/citadelchat_32x.gif\">");
240 if (ib_displayas != IB_PICONLY) {
243 wprintf("</A></li>\n");
248 "<a href=\"display_main_menu\" "
251 _("Advanced Options Menu: Advanced Room commands, Account Info, and Chat")
253 if (ib_displayas != IB_TEXTONLY) {
254 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
255 "src=\"static/advanpage2_32x.gif\">");
257 if (ib_displayas != IB_PICONLY) {
258 wprintf(_("Advanced"));
260 wprintf("</A></li>\n");
263 if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
265 "<a href=\"display_aide_menu\" "
268 _("Room and system administration functions")
270 if (ib_displayas != IB_TEXTONLY) {
271 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
272 "src=\"static/advanpage2_32x.gif\">");
274 if (ib_displayas != IB_PICONLY) {
275 wprintf(_("Administration"));
277 wprintf("</A></li>\n");
282 "<a href=\"termquit\" TITLE=\"%s\" "
283 "onClick=\"return confirm('%s');\">",
288 if (ib_displayas != IB_TEXTONLY) {
289 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
290 "src=\"static/logoff_32x.gif\">");
292 if (ib_displayas != IB_PICONLY) {
293 wprintf(_("Log off"));
295 wprintf("</A></li>\n");
299 "<li><div align=\"center\">"
300 "<a href=\"display_customize_iconbar\" "
304 _("Customize this menu"),
305 _("customize this menu")
314 void display_customize_iconbar(void) {
317 char key[SIZ], value[SIZ];
321 /* The initialized values of these variables also happen to
322 * specify the default values for users who haven't customized
323 * their iconbars. These should probably be set in a master
324 * configuration somewhere.
326 int ib_displayas = IB_PICTEXT; /* pictures and text, pictures, text */
327 int ib_logo = 0; /* Site logo */
328 int ib_summary = 1; /* Summary page icon */
329 int ib_inbox = 1; /* Inbox icon */
330 int ib_calendar = 1; /* Calendar icon */
331 int ib_contacts = 1; /* Contacts icon */
332 int ib_notes = 1; /* Notes icon */
333 int ib_tasks = 1; /* Tasks icon */
334 int ib_rooms = 1; /* Rooms icon */
335 int ib_users = 1; /* Users icon */
336 int ib_chat = 1; /* Chat icon */
337 int ib_advanced = 1; /* Advanced Options icon */
338 int ib_citadel = 1; /* 'Powered by Citadel' logo */
342 get_preference("iconbar", iconbar, sizeof iconbar);
343 for (i=0; i<num_tokens(iconbar, ','); ++i) {
344 extract_token(buf, iconbar, i, ',', sizeof buf);
345 extract_token(key, buf, 0, '=', sizeof key);
346 extract_token(value, buf, 1, '=', sizeof value);
348 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
349 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
350 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
351 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
352 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
353 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
354 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
355 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
356 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
357 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
358 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
359 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
360 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
363 output_headers(1, 1, 2, 0, 0, 0);
364 wprintf("<div id=\"banner\">\n"
365 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
366 "<SPAN CLASS=\"titlebar\">");
367 wprintf(_("Customize the icon bar"));
369 "</TD></TR></TABLE>\n"
370 "</div>\n<div id=\"content\">\n"
373 wprintf("<div id=\"fix_scrollbar_bug\">"
374 "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>");
376 wprintf("<FORM METHOD=\"POST\" action=\"commit_iconbar\">\n");
379 wprintf(_("Display icons as:"));
381 for (i=0; i<=2; ++i) {
382 wprintf("<INPUT TYPE=\"radio\" NAME=\"ib_displayas\" VALUE=\"%d\"", i);
383 if (ib_displayas == i) wprintf(" CHECKED");
385 if (i == IB_PICTEXT) wprintf(_("pictures and text"));
386 if (i == IB_PICONLY) wprintf(_("pictures only"));
387 if (i == IB_TEXTONLY) wprintf(_("text only"));
390 wprintf("<br /><br />\n");
392 wprintf(_("Select the icons you would like to see displayed "
393 "in the 'icon bar' menu on the left side of the "
395 wprintf("</CENTER><br />\n");
397 wprintf("<TABLE border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
399 wprintf("<TR BGCOLOR=%s><TD>"
400 "<INPUT TYPE=\"checkbox\" NAME=\"ib_logo\" VALUE=\"yes\" %s>"
402 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
403 "src=\"image&name=hello\" ALT=\" \">"
408 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
409 (ib_logo ? "CHECKED" : ""),
411 _("An icon describing this site")
414 wprintf("<TR bgcolor=%s><TD>"
415 "<INPUT TYPE=\"checkbox\" NAME=\"ib_summary\" VALUE=\"yes\" %s>"
417 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
418 "src=\"static/summscreen_48x.gif\" ALT=\" \">"
423 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
424 (ib_summary ? "CHECKED" : ""),
426 _("Your summary page")
429 wprintf("<TR bgcolor=%s><TD>"
430 "<INPUT TYPE=\"checkbox\" NAME=\"ib_inbox\" VALUE=\"yes\" %s>"
432 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
433 "src=\"static/privatemess_48x.gif\" ALT=\" \">"
438 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
439 (ib_inbox ? "CHECKED" : ""),
441 _("A shortcut to your email Inbox")
444 wprintf("<TR bgcolor=%s><TD>"
445 "<INPUT TYPE=\"checkbox\" NAME=\"ib_contacts\" "
448 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
449 "src=\"static/viewcontacts_48x.gif\" ALT=\" \">"
454 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
455 (ib_contacts ? "CHECKED" : ""),
457 _("Your personal address book")
460 wprintf("<TR bgcolor=%s><TD>"
461 "<INPUT TYPE=\"checkbox\" NAME=\"ib_notes\" "
464 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
465 "src=\"static/storenotes_48x.gif\" ALT=\" \">"
470 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
471 (ib_notes ? "CHECKED" : ""),
473 _("Your personal notes")
476 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
477 wprintf("<TR bgcolor=%s><TD>"
478 "<INPUT TYPE=\"checkbox\" NAME=\"ib_calendar\" "
481 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
482 "src=\"static/calarea_48x.gif\" ALT=\" \">"
487 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
488 (ib_calendar ? "CHECKED" : ""),
490 _("A shortcut to your personal calendar")
493 wprintf("<TR bgcolor=%s><TD>"
494 "<INPUT TYPE=\"checkbox\" NAME=\"ib_tasks\" VALUE=\"yes\" %s>"
496 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
497 "src=\"static/taskmanag_48x.gif\" ALT=\" \">"
502 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
503 (ib_tasks ? "CHECKED" : ""),
505 _("A shortcut to your personal task list")
507 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
509 wprintf("<TR bgcolor=%s><TD>"
510 "<INPUT TYPE=\"checkbox\" NAME=\"ib_rooms\" VALUE=\"yes\" %s>"
512 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
513 "src=\"static/chatrooms_48x.gif\" ALT=\" \">"
518 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
519 (ib_rooms ? "CHECKED" : ""),
521 _("Clicking this icon displays a list of all accesible "
522 "rooms (or folders) available.")
525 wprintf("<TR bgcolor=%s><TD>"
526 "<INPUT TYPE=\"checkbox\" NAME=\"ib_users\" VALUE=\"yes\" %s>"
528 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
529 "src=\"static/usermanag_48x.gif\" ALT=\" \">"
534 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
535 (ib_users ? "CHECKED" : ""),
537 _("Clicking this icon displays a list of all users "
538 "currently logged in.")
541 wprintf("<TR bgcolor=%s><TD>"
542 "<INPUT TYPE=\"checkbox\" NAME=\"ib_chat\" VALUE=\"yes\" %s>"
544 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
545 "src=\"static/citadelchat_48x.gif\" ALT=\" \">"
550 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
551 (ib_chat ? "CHECKED" : ""),
553 _("Clicking this icon enters real-time chat mode "
554 "with other users in the same room.")
558 wprintf("<TR bgcolor=%s><TD>"
559 "<INPUT TYPE=\"checkbox\" NAME=\"ib_advanced\" "
562 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
563 "src=\"static/advanpage2_48x.gif\" ALT=\" \">"
568 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
569 (ib_advanced ? "CHECKED" : ""),
570 _("Advanced options"),
571 _("Access to the complete menu of Citadel functions.")
575 wprintf("<TR bgcolor=%s><TD>"
576 "<INPUT TYPE=\"checkbox\" NAME=\"ib_citadel\" "
579 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
580 "src=\"static/citadel-logo.gif\" ALT=\" \">"
585 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
586 (ib_citadel ? "CHECKED" : ""),
588 _("Displays the 'Powered by Citadel' icon")
591 wprintf("</TABLE><br />\n"
593 "<INPUT TYPE=\"submit\" NAME=\"ok_button\" VALUE=\"%s\">"
595 "<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">"
596 "</CENTER></FORM>\n",
601 wprintf("</td></tr></table></div>\n");
606 void commit_iconbar(void) {
626 if (strlen(bstr("ok_button")) == 0) {
631 sprintf(iconbar, "ib_displayas=%d", atoi(bstr("ib_displayas")));
633 for (i=0; i<(sizeof(boxen)/sizeof(char *)); ++i) {
634 sprintf(&iconbar[strlen(iconbar)], ",%s=", boxen[i]);
635 if (!strcasecmp(bstr(boxen[i]), "yes")) {
636 sprintf(&iconbar[strlen(iconbar)], "1");
639 sprintf(&iconbar[strlen(iconbar)], "0");
643 set_preference("iconbar", iconbar, 1);
645 output_headers(1, 1, 0, 0, 0, 0);
647 "<center><table border=1 bgcolor=\"#ffffff\"><tr><td>"
648 "<img src=\"static/advanpage2_48x.gif\">"
650 wprintf(_("Your icon bar has been updated. Please select any of its "
651 "choices to continue."));
652 wprintf("</td></tr></table>\n");