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