new mail notification
[citadel.git] / webcit / iconbar.c
1 /*
2  * $Id$
3  *
4  * Displays and customizes the iconbar.
5  */
6
7 #include "webcit.h"
8
9
10 /* Values for ib_displayas */
11 #define IB_PICTEXT      0
12 #define IB_PICONLY      1
13 #define IB_TEXTONLY     2
14
15 void do_iconbar(void) {
16         char iconbar[SIZ];
17         char buf[SIZ];
18         char key[SIZ], value[SIZ];
19         int i;
20
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.
25          */
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 */
39         /*
40          */
41
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);
47
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);
61         }
62
63         wprintf("<div id=\"button\">\n"
64                 "<ul>\n"
65         );
66
67         if (ib_logo) {
68                 wprintf("<li>");
69                 if (ib_displayas != IB_TEXTONLY) {
70                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" "
71                                 "HEIGHT=\"32\" SRC=\"/image&name=hello\" ALT=\"&nbsp;\">\n"
72                         );
73                 }
74                 wprintf("</li>\n");
75         }
76
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\">"
81                 "<img border=\"0\" "
82                 "SRC=\"/static/citadel-logo.gif\" ALT=\"%s\"></a>"
83                 "</div></li>\n",
84                 _("Find out more about Citadel"),
85                 _("CITADEL")
86         );
87
88
89         if (ib_summary) {
90                 wprintf("<li><A HREF=\"/summary\" "
91                         "TITLE=\"%s\" "
92                         ">", _("Your summary page")
93                 );
94                 if (ib_displayas != IB_TEXTONLY) {
95                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
96                                 "SRC=\"/static/summscreen_32x.gif\">");
97                 }
98                 if (ib_displayas != IB_PICONLY) {
99                         wprintf(_("Summary"));
100                 }
101                 wprintf("</A></li>\n");
102         }
103
104         if (ib_inbox) {
105                 wprintf("<li>"
106                         "<A HREF=\"/dotgoto?room=_MAIL_\" "
107                         "TITLE=\"%s\" "
108                         ">",
109                         _("Go to your email inbox")
110                 );
111                 if (ib_displayas != IB_TEXTONLY) {
112                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
113                                 "SRC=\"/static/privatemess_32x.gif\">");
114                 }
115                 if (ib_displayas != IB_PICONLY) {
116                         wprintf(_("Mail"));
117                         if (WC->new_mail != WC->remember_new_mail) {
118                                 wprintf(" <b>(%d)</b>", WC->new_mail);
119                                 WC->remember_new_mail = WC->new_mail;
120                         }
121                 }
122                 wprintf("</A></li>\n");
123         }
124
125         if (ib_calendar) {
126                 wprintf("<li>"
127                         "<A HREF=\"/dotgoto?room=_CALENDAR_\" "
128                         "TITLE=\"%s\" "
129                         ">",
130                         _("Go to your personal calendar")
131                 );
132                 if (ib_displayas != IB_TEXTONLY) {
133                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
134                         "SRC=\"/static/calarea_32x.gif\">");
135                 }
136                 if (ib_displayas != IB_PICONLY) {
137                         wprintf(_("Calendar"));
138                 }
139                 wprintf("</A></li>\n");
140         }
141
142         if (ib_contacts) {
143                 wprintf("<li>"
144                         "<A HREF=\"/dotgoto?room=_CONTACTS_\" "
145                         "TITLE=\"%s\" "
146                         ">",
147                         _("Go to your personal address book")
148                 );
149                 if (ib_displayas != IB_TEXTONLY) {
150                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
151                         "SRC=\"/static/viewcontacts_32x.gif\">");
152                 }
153                 if (ib_displayas != IB_PICONLY) {
154                         wprintf(_("Contacts"));
155                 }
156                 wprintf("</A></li>\n");
157         }
158
159         if (ib_notes) {
160                 wprintf("<li>"
161                         "<A HREF=\"/dotgoto?room=_NOTES_\" "
162                         "TITLE=\"%s\" "
163                         ">",
164                         _("Go to your personal notes")
165                 );
166                 if (ib_displayas != IB_TEXTONLY) {
167                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
168                         "SRC=\"/static/storenotes_32x.gif\">");
169                 }
170                 if (ib_displayas != IB_PICONLY) {
171                         wprintf(_("Notes"));
172                 }
173                 wprintf("</A></li>\n");
174         }
175
176         if (ib_tasks)  {
177                 wprintf("<li>"
178                         "<A HREF=\"/dotgoto?room=_TASKS_\" "
179                         "TITLE=\"%s\" "
180                         ">",
181                         _("Go to your personal task list")
182                 );
183                 if (ib_displayas != IB_TEXTONLY) {
184                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
185                         "SRC=\"/static/taskmanag_32x.gif\">");
186                 }
187                 if (ib_displayas != IB_PICONLY) {
188                         wprintf(_("Tasks"));
189                 }
190                 wprintf("</A></li>\n");
191         }
192
193         if (ib_rooms) {
194                 wprintf("<li>"
195                         "<A HREF=\"/knrooms\" TITLE=\"%s\" >",
196                         _("List all of your accessible rooms")
197                 );
198                 if (ib_displayas != IB_TEXTONLY) {
199                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
200                         "SRC=\"/static/chatrooms_32x.gif\">");
201                 }
202                 if (ib_displayas != IB_PICONLY) {
203                         wprintf(_("Rooms"));
204                 }
205                 wprintf("</A></li>\n");
206         }
207
208         if (ib_users) {
209                 wprintf("<li>"
210                         "<A HREF=\"/who\" TITLE=\"%s\" "
211                         ">",
212                         _("See who is online right now")
213                 );
214                 if (ib_displayas != IB_TEXTONLY) {
215                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
216                         "SRC=\"/static/usermanag_32x.gif\">");
217                 }
218                 if (ib_displayas != IB_PICONLY) {
219                         wprintf(_("Who is online?"));
220                 }
221                 wprintf("</A></li>\n");
222         }
223
224         if (ib_chat) {
225                 wprintf("<li>"
226                         "<A HREF=\"#\" onClick=\"window.open('/chat', "
227                         "'ctdl_chat_window', "
228                         "'toolbar=no,location=no,directories=no,copyhistory=no,"
229                         "status=no,scrollbars=yes,resizable=yes');\""
230                         ">"
231                 );
232                 if (ib_displayas != IB_TEXTONLY) {
233                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
234                         "SRC=\"/static/citadelchat_32x.gif\">");
235                 }
236                 if (ib_displayas != IB_PICONLY) {
237                         wprintf(_("Chat"));
238                 }
239                 wprintf("</A></li>\n");
240         }
241
242         if (ib_advanced) {
243                 wprintf("<li>"
244                         "<A HREF=\"/display_main_menu\" "
245                         "TITLE=\"%s\" "
246                         ">",
247                         _("Advanced Options Menu: Advanced Room commands, Account Info, and Chat")
248                 );
249                 if (ib_displayas != IB_TEXTONLY) {
250                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
251                         "SRC=\"/static/advanpage2_32x.gif\">");
252                 }
253                 if (ib_displayas != IB_PICONLY) {
254                         wprintf(_("Advanced"));
255                 }
256                 wprintf("</A></li>\n");
257         }
258
259         if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
260                 wprintf("<li>"
261                         "<A HREF=\"/display_aide_menu\" "
262                         "TITLE=\"%s\" "
263                         ">",
264                         _("Room and system administration functions")
265                 );
266                 if (ib_displayas != IB_TEXTONLY) {
267                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
268                         "SRC=\"/static/advanpage2_32x.gif\">");
269                 }
270                 if (ib_displayas != IB_PICONLY) {
271                         wprintf(_("Administration"));
272                 }
273                 wprintf("</A></li>\n");
274         }
275
276         if (1) {
277                 wprintf("<li>"
278                         "<A HREF=\"/termquit\" TITLE=\"%s\" "
279                         "onClick=\"return confirm('%s');\">",
280                         _("Log off"),
281                         _("Log off now?")
282                         
283                 );
284                 if (ib_displayas != IB_TEXTONLY) {
285                 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
286                         "SRC=\"/static/logoff_32x.gif\">");
287                 }
288                 if (ib_displayas != IB_PICONLY) {
289                         wprintf(_("Log off"));
290                 }
291                 wprintf("</A></li>\n");
292         }
293
294         wprintf(
295                 "<li><div align=\"center\">"
296                 "<A HREF=\"/display_customize_iconbar\" "
297                 "TITLE=\"%s\" "
298                 ">%s"
299                 "</A></div></li>\n",
300                 _("Customize this menu"),
301                 _("customize this menu")
302         );
303
304         wprintf("</ul>\n"
305                 "</div>\n");
306 }
307
308
309
310 void display_customize_iconbar(void) {
311         char iconbar[SIZ];
312         char buf[SIZ];
313         char key[SIZ], value[SIZ];
314         int i;
315         int bar = 0;
316
317         /* The initialized values of these variables also happen to
318          * specify the default values for users who haven't customized
319          * their iconbars.  These should probably be set in a master
320          * configuration somewhere.
321          */
322         int ib_displayas = IB_PICTEXT;  /* pictures and text, pictures, text */
323         int ib_logo = 0;        /* Site logo */
324         int ib_summary = 1;     /* Summary page icon */
325         int ib_inbox = 1;       /* Inbox icon */
326         int ib_calendar = 1;    /* Calendar icon */
327         int ib_contacts = 1;    /* Contacts icon */
328         int ib_notes = 1;       /* Notes icon */
329         int ib_tasks = 1;       /* Tasks icon */
330         int ib_rooms = 1;       /* Rooms icon */
331         int ib_users = 1;       /* Users icon */
332         int ib_chat = 1;        /* Chat icon */
333         int ib_advanced = 1;    /* Advanced Options icon */
334         int ib_citadel = 1;     /* 'Powered by Citadel' logo */
335         /*
336          */
337
338         get_preference("iconbar", iconbar, sizeof iconbar);
339         for (i=0; i<num_tokens(iconbar, ','); ++i) {
340                 extract_token(buf, iconbar, i, ',', sizeof buf);
341                 extract_token(key, buf, 0, '=', sizeof key);
342                 extract_token(value, buf, 1, '=', sizeof value);
343
344                 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
345                 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
346                 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
347                 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
348                 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
349                 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
350                 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
351                 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
352                 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
353                 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
354                 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
355                 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
356                 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
357         }
358
359         output_headers(1, 1, 2, 0, 0, 0);
360         wprintf("<div id=\"banner\">\n"
361                 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
362                 "<SPAN CLASS=\"titlebar\">");
363         wprintf(_("Customize the icon bar"));
364         wprintf("</SPAN>"
365                 "</TD></TR></TABLE>\n"
366                 "</div>\n<div id=\"content\">\n"
367         );
368
369         wprintf("<div id=\"fix_scrollbar_bug\">"
370                 "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>");
371
372         wprintf("<FORM METHOD=\"POST\" ACTION=\"/commit_iconbar\">\n");
373
374         wprintf("<CENTER>");
375         wprintf(_("Display icons as:"));
376         wprintf(" ");
377         for (i=0; i<=2; ++i) {
378                 wprintf("<INPUT TYPE=\"radio\" NAME=\"ib_displayas\" VALUE=\"%d\"", i);
379                 if (ib_displayas == i) wprintf(" CHECKED");
380                 wprintf(">");
381                 if (i == IB_PICTEXT)    wprintf(_("pictures and text"));
382                 if (i == IB_PICONLY)    wprintf(_("pictures only"));
383                 if (i == IB_TEXTONLY)   wprintf(_("text only"));
384                 wprintf("\n");
385         }
386         wprintf("<br /><br />\n");
387
388         wprintf(_("Select the icons you would like to see displayed "
389                 "in the 'icon bar' menu on the left side of the "
390                 "screen."));
391         wprintf("</CENTER><br />\n");
392
393         wprintf("<TABLE border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
394
395         wprintf("<TR BGCOLOR=%s><TD>"
396                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_logo\" VALUE=\"yes\" %s>"
397                 "</TD><TD>"
398                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
399                 "SRC=\"/image&name=hello\" ALT=\"&nbsp;\">"
400                 "</TD><TD>"
401                 "<B>%s</B><br />"
402                 "%s"
403                 "</TD></TR>\n",
404                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
405                 (ib_logo ? "CHECKED" : ""),
406                 _("Site logo"),
407                 _("An icon describing this site")
408         );
409
410         wprintf("<TR bgcolor=%s><TD>"
411                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_summary\" VALUE=\"yes\" %s>"
412                 "</TD><TD>"
413                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
414                 "SRC=\"/static/summscreen_48x.gif\" ALT=\"&nbsp;\">"
415                 "</TD><TD>"
416                 "<B>%s</B><br />"
417                 "%s"
418                 "</TD></TR>\n",
419                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
420                 (ib_summary ? "CHECKED" : ""),
421                 _("Summary"),
422                 _("Your summary page")
423         );
424
425         wprintf("<TR bgcolor=%s><TD>"
426                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_inbox\" VALUE=\"yes\" %s>"
427                 "</TD><TD>"
428                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
429                 "SRC=\"/static/privatemess_48x.gif\" ALT=\"&nbsp;\">"
430                 "</TD><TD>"
431                 "<B>%s</B><br />"
432                 "%s"
433                 "</TD></TR>\n",
434                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
435                 (ib_inbox ? "CHECKED" : ""),
436                 _("Mail (inbox)"),
437                 _("A shortcut to your email Inbox")
438         );
439
440         wprintf("<TR bgcolor=%s><TD>"
441                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_contacts\" "
442                 "VALUE=\"yes\" %s>"
443                 "</TD><TD>"
444                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
445                 "SRC=\"/static/viewcontacts_48x.gif\" ALT=\"&nbsp;\">"
446                 "</TD><TD>"
447                 "<B>%s</B><br />"
448                 "%s"
449                 "</TD></TR>\n",
450                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
451                 (ib_contacts ? "CHECKED" : ""),
452                 _("Contacts"),
453                 _("Your personal address book")
454         );
455
456         wprintf("<TR bgcolor=%s><TD>"
457                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_notes\" "
458                 "VALUE=\"yes\" %s>"
459                 "</TD><TD>"
460                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
461                 "SRC=\"/static/storenotes_48x.gif\" ALT=\"&nbsp;\">"
462                 "</TD><TD>"
463                 "<B>%s</B><br />"
464                 "%s"
465                 "</TD></TR>\n",
466                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
467                 (ib_notes ? "CHECKED" : ""),
468                 _("Notes"),
469                 _("Your personal notes")
470         );
471
472 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
473         wprintf("<TR bgcolor=%s><TD>"
474                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_calendar\" "
475                 "VALUE=\"yes\" %s>"
476                 "</TD><TD>"
477                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
478                 "SRC=\"/static/calarea_48x.gif\" ALT=\"&nbsp;\">"
479                 "</TD><TD>"
480                 "<B>%s</B><br />"
481                 "%s"
482                 "</TD></TR>\n",
483                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
484                 (ib_calendar ? "CHECKED" : ""),
485                 _("Calendar"),
486                 _("A shortcut to your personal calendar")
487         );
488
489         wprintf("<TR bgcolor=%s><TD>"
490                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_tasks\" VALUE=\"yes\" %s>"
491                 "</TD><TD>"
492                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
493                 "SRC=\"/static/taskmanag_48x.gif\" ALT=\"&nbsp;\">"
494                 "</TD><TD>"
495                 "<B>%s</B><br />"
496                 "%s"
497                 "</TD></TR>\n",
498                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
499                 (ib_tasks ? "CHECKED" : ""),
500                 _("Tasks"),
501                 _("A shortcut to your personal task list")
502         );
503 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
504
505         wprintf("<TR bgcolor=%s><TD>"
506                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_rooms\" VALUE=\"yes\" %s>"
507                 "</TD><TD>"
508                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
509                 "SRC=\"/static/chatrooms_48x.gif\" ALT=\"&nbsp;\">"
510                 "</TD><TD>"
511                 "<B>%s</B><br />"
512                 "%s"
513                 "</TD></TR>\n",
514                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
515                 (ib_rooms ? "CHECKED" : ""),
516                 _("Rooms"),
517                 _("Clicking this icon displays a list of all accesible "
518                 "rooms (or folders) available.")
519         );
520
521         wprintf("<TR bgcolor=%s><TD>"
522                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_users\" VALUE=\"yes\" %s>"
523                 "</TD><TD>"
524                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
525                 "SRC=\"/static/usermanag_48x.gif\" ALT=\"&nbsp;\">"
526                 "</TD><TD>"
527                 "<B>%s</B><br />"
528                 "%s"
529                 "</TD></TR>\n",
530                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
531                 (ib_users ? "CHECKED" : ""),
532                 _("Who is online?"),
533                 _("Clicking this icon displays a list of all users "
534                 "currently logged in.")
535         );
536
537         wprintf("<TR bgcolor=%s><TD>"
538                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_chat\" VALUE=\"yes\" %s>"
539                 "</TD><TD>"
540                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
541                 "SRC=\"/static/citadelchat_48x.gif\" ALT=\"&nbsp;\">"
542                 "</TD><TD>"
543                 "<B>%s</B><br />"
544                 "%s"
545                 "</TD></TR>\n",
546                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
547                 (ib_chat ? "CHECKED" : ""),
548                 _("Chat"),
549                 _("Clicking this icon enters real-time chat mode "
550                 "with other users in the same room.")
551                 
552         );
553
554         wprintf("<TR bgcolor=%s><TD>"
555                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_advanced\" "
556                 "VALUE=\"yes\" %s>"
557                 "</TD><TD>"
558                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
559                 "SRC=\"/static/advanpage2_48x.gif\" ALT=\"&nbsp;\">"
560                 "</TD><TD>"
561                 "<B>%s</B><br />"
562                 "%s"
563                 "</TD></TR>\n",
564                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
565                 (ib_advanced ? "CHECKED" : ""),
566                 _("Advanced options"),
567                 _("Access to the complete menu of Citadel functions.")
568
569         );
570
571         wprintf("<TR bgcolor=%s><TD>"
572                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_citadel\" "
573                 "VALUE=\"yes\" %s>"
574                 "</TD><TD>"
575                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
576                 "SRC=\"/static/citadel-logo.gif\" ALT=\"&nbsp;\">"
577                 "</TD><TD>"
578                 "<B>%s</B><br />"
579                 "%s"
580                 "</TD></TR>\n",
581                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
582                 (ib_citadel ? "CHECKED" : ""),
583                 _("Citadel logo"),
584                 _("Displays the 'Powered by Citadel' icon")
585         );
586
587         wprintf("</TABLE><br />\n"
588                 "<CENTER>"
589                 "<INPUT TYPE=\"submit\" NAME=\"ok_button\" VALUE=\"%s\">"
590                 "&nbsp;"
591                 "<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">"
592                 "</CENTER></FORM>\n",
593                 _("Save changes"),
594                 _("Cancel")
595         );
596
597         wprintf("</td></tr></table></div>\n");
598         wDumpContent(2);
599 }
600
601
602 void commit_iconbar(void) {
603         char iconbar[SIZ];
604         int i;
605
606         char *boxen[] = {
607                 "ib_logo",
608                 "ib_summary",
609                 "ib_inbox",
610                 "ib_calendar",
611                 "ib_contacts",
612                 "ib_notes",
613                 "ib_tasks",
614                 "ib_rooms",
615                 "ib_users",
616                 "ib_chat",
617                 "ib_advanced",
618                 "ib_logoff",
619                 "ib_citadel"
620         };
621
622         if (strlen(bstr("ok_button")) == 0) {
623                 display_main_menu();
624                 return;
625         }
626
627         sprintf(iconbar, "ib_displayas=%d", atoi(bstr("ib_displayas")));
628
629         for (i=0; i<(sizeof(boxen)/sizeof(char *)); ++i) {
630                 sprintf(&iconbar[strlen(iconbar)], ",%s=", boxen[i]);
631                 if (!strcasecmp(bstr(boxen[i]), "yes")) {
632                         sprintf(&iconbar[strlen(iconbar)], "1");
633                 }
634                 else {
635                         sprintf(&iconbar[strlen(iconbar)], "0");
636                 }
637         }
638
639         set_preference("iconbar", iconbar, 1);
640
641         output_headers(1, 1, 0, 0, 0, 0);
642         wprintf(
643                 "<center><table border=1 bgcolor=\"#ffffff\"><tr><td>"
644                 "<IMG SRC=\"/static/advanpage2_48x.gif\">"
645                 "&nbsp;");
646         wprintf(_("Your icon bar has been updated.  Please select any of its "
647                 "choices to continue."));
648         wprintf("</td></tr></table>\n");
649         wDumpContent(2);
650 }