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")
310 wprintf("<div id=\"dropstuff\">Drag to trash here...</div>");
317 void display_customize_iconbar(void) {
320 char key[SIZ], value[SIZ];
324 /* The initialized values of these variables also happen to
325 * specify the default values for users who haven't customized
326 * their iconbars. These should probably be set in a master
327 * configuration somewhere.
329 int ib_displayas = IB_PICTEXT; /* pictures and text, pictures, text */
330 int ib_logo = 0; /* Site logo */
331 int ib_summary = 1; /* Summary page icon */
332 int ib_inbox = 1; /* Inbox icon */
333 int ib_calendar = 1; /* Calendar icon */
334 int ib_contacts = 1; /* Contacts icon */
335 int ib_notes = 1; /* Notes icon */
336 int ib_tasks = 1; /* Tasks icon */
337 int ib_rooms = 1; /* Rooms icon */
338 int ib_users = 1; /* Users icon */
339 int ib_chat = 1; /* Chat icon */
340 int ib_advanced = 1; /* Advanced Options icon */
341 int ib_citadel = 1; /* 'Powered by Citadel' logo */
345 get_preference("iconbar", iconbar, sizeof iconbar);
346 for (i=0; i<num_tokens(iconbar, ','); ++i) {
347 extract_token(buf, iconbar, i, ',', sizeof buf);
348 extract_token(key, buf, 0, '=', sizeof key);
349 extract_token(value, buf, 1, '=', sizeof value);
351 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
352 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
353 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
354 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
355 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
356 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
357 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
358 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
359 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
360 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
361 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
362 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
363 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
366 output_headers(1, 1, 2, 0, 0, 0);
367 wprintf("<div id=\"banner\">\n"
368 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
369 "<SPAN CLASS=\"titlebar\">");
370 wprintf(_("Customize the icon bar"));
372 "</TD></TR></TABLE>\n"
373 "</div>\n<div id=\"content\">\n"
376 wprintf("<div id=\"fix_scrollbar_bug\">"
377 "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>");
379 wprintf("<FORM METHOD=\"POST\" action=\"commit_iconbar\">\n");
382 wprintf(_("Display icons as:"));
384 for (i=0; i<=2; ++i) {
385 wprintf("<INPUT TYPE=\"radio\" NAME=\"ib_displayas\" VALUE=\"%d\"", i);
386 if (ib_displayas == i) wprintf(" CHECKED");
388 if (i == IB_PICTEXT) wprintf(_("pictures and text"));
389 if (i == IB_PICONLY) wprintf(_("pictures only"));
390 if (i == IB_TEXTONLY) wprintf(_("text only"));
393 wprintf("<br /><br />\n");
395 wprintf(_("Select the icons you would like to see displayed "
396 "in the 'icon bar' menu on the left side of the "
398 wprintf("</CENTER><br />\n");
400 wprintf("<TABLE border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
402 wprintf("<TR BGCOLOR=%s><TD>"
403 "<INPUT TYPE=\"checkbox\" NAME=\"ib_logo\" VALUE=\"yes\" %s>"
405 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
406 "src=\"image&name=hello\" ALT=\" \">"
411 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
412 (ib_logo ? "CHECKED" : ""),
414 _("An icon describing this site")
417 wprintf("<TR bgcolor=%s><TD>"
418 "<INPUT TYPE=\"checkbox\" NAME=\"ib_summary\" VALUE=\"yes\" %s>"
420 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
421 "src=\"static/summscreen_48x.gif\" ALT=\" \">"
426 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
427 (ib_summary ? "CHECKED" : ""),
429 _("Your summary page")
432 wprintf("<TR bgcolor=%s><TD>"
433 "<INPUT TYPE=\"checkbox\" NAME=\"ib_inbox\" VALUE=\"yes\" %s>"
435 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
436 "src=\"static/privatemess_48x.gif\" ALT=\" \">"
441 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
442 (ib_inbox ? "CHECKED" : ""),
444 _("A shortcut to your email Inbox")
447 wprintf("<TR bgcolor=%s><TD>"
448 "<INPUT TYPE=\"checkbox\" NAME=\"ib_contacts\" "
451 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
452 "src=\"static/viewcontacts_48x.gif\" ALT=\" \">"
457 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
458 (ib_contacts ? "CHECKED" : ""),
460 _("Your personal address book")
463 wprintf("<TR bgcolor=%s><TD>"
464 "<INPUT TYPE=\"checkbox\" NAME=\"ib_notes\" "
467 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
468 "src=\"static/storenotes_48x.gif\" ALT=\" \">"
473 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
474 (ib_notes ? "CHECKED" : ""),
476 _("Your personal notes")
479 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
480 wprintf("<TR bgcolor=%s><TD>"
481 "<INPUT TYPE=\"checkbox\" NAME=\"ib_calendar\" "
484 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
485 "src=\"static/calarea_48x.gif\" ALT=\" \">"
490 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
491 (ib_calendar ? "CHECKED" : ""),
493 _("A shortcut to your personal calendar")
496 wprintf("<TR bgcolor=%s><TD>"
497 "<INPUT TYPE=\"checkbox\" NAME=\"ib_tasks\" VALUE=\"yes\" %s>"
499 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
500 "src=\"static/taskmanag_48x.gif\" ALT=\" \">"
505 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
506 (ib_tasks ? "CHECKED" : ""),
508 _("A shortcut to your personal task list")
510 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
512 wprintf("<TR bgcolor=%s><TD>"
513 "<INPUT TYPE=\"checkbox\" NAME=\"ib_rooms\" VALUE=\"yes\" %s>"
515 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
516 "src=\"static/chatrooms_48x.gif\" ALT=\" \">"
521 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
522 (ib_rooms ? "CHECKED" : ""),
524 _("Clicking this icon displays a list of all accesible "
525 "rooms (or folders) available.")
528 wprintf("<TR bgcolor=%s><TD>"
529 "<INPUT TYPE=\"checkbox\" NAME=\"ib_users\" VALUE=\"yes\" %s>"
531 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
532 "src=\"static/usermanag_48x.gif\" ALT=\" \">"
537 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
538 (ib_users ? "CHECKED" : ""),
540 _("Clicking this icon displays a list of all users "
541 "currently logged in.")
544 wprintf("<TR bgcolor=%s><TD>"
545 "<INPUT TYPE=\"checkbox\" NAME=\"ib_chat\" VALUE=\"yes\" %s>"
547 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
548 "src=\"static/citadelchat_48x.gif\" ALT=\" \">"
553 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
554 (ib_chat ? "CHECKED" : ""),
556 _("Clicking this icon enters real-time chat mode "
557 "with other users in the same room.")
561 wprintf("<TR bgcolor=%s><TD>"
562 "<INPUT TYPE=\"checkbox\" NAME=\"ib_advanced\" "
565 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
566 "src=\"static/advanpage2_48x.gif\" ALT=\" \">"
571 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
572 (ib_advanced ? "CHECKED" : ""),
573 _("Advanced options"),
574 _("Access to the complete menu of Citadel functions.")
578 wprintf("<TR bgcolor=%s><TD>"
579 "<INPUT TYPE=\"checkbox\" NAME=\"ib_citadel\" "
582 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
583 "src=\"static/citadel-logo.gif\" ALT=\" \">"
588 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
589 (ib_citadel ? "CHECKED" : ""),
591 _("Displays the 'Powered by Citadel' icon")
594 wprintf("</TABLE><br />\n"
596 "<INPUT TYPE=\"submit\" NAME=\"ok_button\" VALUE=\"%s\">"
598 "<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">"
599 "</CENTER></FORM>\n",
604 wprintf("</td></tr></table></div>\n");
609 void commit_iconbar(void) {
629 if (strlen(bstr("ok_button")) == 0) {
634 sprintf(iconbar, "ib_displayas=%d", atoi(bstr("ib_displayas")));
636 for (i=0; i<(sizeof(boxen)/sizeof(char *)); ++i) {
637 sprintf(&iconbar[strlen(iconbar)], ",%s=", boxen[i]);
638 if (!strcasecmp(bstr(boxen[i]), "yes")) {
639 sprintf(&iconbar[strlen(iconbar)], "1");
642 sprintf(&iconbar[strlen(iconbar)], "0");
646 set_preference("iconbar", iconbar, 1);
648 output_headers(1, 1, 0, 0, 0, 0);
650 "<center><table border=1 bgcolor=\"#ffffff\"><tr><td>"
651 "<img src=\"static/advanpage2_48x.gif\">"
653 wprintf(_("Your icon bar has been updated. Please select any of its "
654 "choices to continue."));
655 wprintf("</td></tr></table>\n");