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