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