(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                 "</div>\n");
310 }
311
312
313
314 void display_customize_iconbar(void) {
315         char iconbar[SIZ];
316         char buf[SIZ];
317         char key[SIZ], value[SIZ];
318         int i;
319         int bar = 0;
320
321         /* The initialized values of these variables also happen to
322          * specify the default values for users who haven't customized
323          * their iconbars.  These should probably be set in a master
324          * configuration somewhere.
325          */
326         int ib_displayas = IB_PICTEXT;  /* pictures and text, pictures, text */
327         int ib_logo = 0;        /* Site logo */
328         int ib_summary = 1;     /* Summary page icon */
329         int ib_inbox = 1;       /* Inbox icon */
330         int ib_calendar = 1;    /* Calendar icon */
331         int ib_contacts = 1;    /* Contacts icon */
332         int ib_notes = 1;       /* Notes icon */
333         int ib_tasks = 1;       /* Tasks icon */
334         int ib_rooms = 1;       /* Rooms icon */
335         int ib_users = 1;       /* Users icon */
336         int ib_chat = 1;        /* Chat icon */
337         int ib_advanced = 1;    /* Advanced Options icon */
338         int ib_citadel = 1;     /* 'Powered by Citadel' logo */
339         /*
340          */
341
342         get_preference("iconbar", iconbar, sizeof iconbar);
343         for (i=0; i<num_tokens(iconbar, ','); ++i) {
344                 extract_token(buf, iconbar, i, ',', sizeof buf);
345                 extract_token(key, buf, 0, '=', sizeof key);
346                 extract_token(value, buf, 1, '=', sizeof value);
347
348                 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
349                 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
350                 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
351                 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
352                 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
353                 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
354                 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
355                 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
356                 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
357                 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
358                 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
359                 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
360                 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
361         }
362
363         output_headers(1, 1, 2, 0, 0, 0);
364         wprintf("<div id=\"banner\">\n"
365                 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
366                 "<SPAN CLASS=\"titlebar\">");
367         wprintf(_("Customize the icon bar"));
368         wprintf("</SPAN>"
369                 "</TD></TR></TABLE>\n"
370                 "</div>\n<div id=\"content\">\n"
371         );
372
373         wprintf("<div id=\"fix_scrollbar_bug\">"
374                 "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>");
375
376         wprintf("<FORM METHOD=\"POST\" ACTION=\"/commit_iconbar\">\n");
377
378         wprintf("<CENTER>");
379         wprintf(_("Display icons as:"));
380         wprintf(" ");
381         for (i=0; i<=2; ++i) {
382                 wprintf("<INPUT TYPE=\"radio\" NAME=\"ib_displayas\" VALUE=\"%d\"", i);
383                 if (ib_displayas == i) wprintf(" CHECKED");
384                 wprintf(">");
385                 if (i == IB_PICTEXT)    wprintf(_("pictures and text"));
386                 if (i == IB_PICONLY)    wprintf(_("pictures only"));
387                 if (i == IB_TEXTONLY)   wprintf(_("text only"));
388                 wprintf("\n");
389         }
390         wprintf("<br /><br />\n");
391
392         wprintf(_("Select the icons you would like to see displayed "
393                 "in the 'icon bar' menu on the left side of the "
394                 "screen."));
395         wprintf("</CENTER><br />\n");
396
397         wprintf("<TABLE border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
398
399         wprintf("<TR BGCOLOR=%s><TD>"
400                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_logo\" VALUE=\"yes\" %s>"
401                 "</TD><TD>"
402                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
403                 "SRC=\"/image&name=hello\" ALT=\"&nbsp;\">"
404                 "</TD><TD>"
405                 "<B>%s</B><br />"
406                 "%s"
407                 "</TD></TR>\n",
408                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
409                 (ib_logo ? "CHECKED" : ""),
410                 _("Site logo"),
411                 _("An icon describing this site")
412         );
413
414         wprintf("<TR bgcolor=%s><TD>"
415                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_summary\" VALUE=\"yes\" %s>"
416                 "</TD><TD>"
417                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
418                 "SRC=\"/static/summscreen_48x.gif\" ALT=\"&nbsp;\">"
419                 "</TD><TD>"
420                 "<B>%s</B><br />"
421                 "%s"
422                 "</TD></TR>\n",
423                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
424                 (ib_summary ? "CHECKED" : ""),
425                 _("Summary"),
426                 _("Your summary page")
427         );
428
429         wprintf("<TR bgcolor=%s><TD>"
430                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_inbox\" VALUE=\"yes\" %s>"
431                 "</TD><TD>"
432                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
433                 "SRC=\"/static/privatemess_48x.gif\" ALT=\"&nbsp;\">"
434                 "</TD><TD>"
435                 "<B>%s</B><br />"
436                 "%s"
437                 "</TD></TR>\n",
438                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
439                 (ib_inbox ? "CHECKED" : ""),
440                 _("Mail (inbox)"),
441                 _("A shortcut to your email Inbox")
442         );
443
444         wprintf("<TR bgcolor=%s><TD>"
445                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_contacts\" "
446                 "VALUE=\"yes\" %s>"
447                 "</TD><TD>"
448                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
449                 "SRC=\"/static/viewcontacts_48x.gif\" ALT=\"&nbsp;\">"
450                 "</TD><TD>"
451                 "<B>%s</B><br />"
452                 "%s"
453                 "</TD></TR>\n",
454                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
455                 (ib_contacts ? "CHECKED" : ""),
456                 _("Contacts"),
457                 _("Your personal address book")
458         );
459
460         wprintf("<TR bgcolor=%s><TD>"
461                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_notes\" "
462                 "VALUE=\"yes\" %s>"
463                 "</TD><TD>"
464                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
465                 "SRC=\"/static/storenotes_48x.gif\" ALT=\"&nbsp;\">"
466                 "</TD><TD>"
467                 "<B>%s</B><br />"
468                 "%s"
469                 "</TD></TR>\n",
470                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
471                 (ib_notes ? "CHECKED" : ""),
472                 _("Notes"),
473                 _("Your personal notes")
474         );
475
476 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
477         wprintf("<TR bgcolor=%s><TD>"
478                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_calendar\" "
479                 "VALUE=\"yes\" %s>"
480                 "</TD><TD>"
481                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
482                 "SRC=\"/static/calarea_48x.gif\" ALT=\"&nbsp;\">"
483                 "</TD><TD>"
484                 "<B>%s</B><br />"
485                 "%s"
486                 "</TD></TR>\n",
487                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
488                 (ib_calendar ? "CHECKED" : ""),
489                 _("Calendar"),
490                 _("A shortcut to your personal calendar")
491         );
492
493         wprintf("<TR bgcolor=%s><TD>"
494                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_tasks\" VALUE=\"yes\" %s>"
495                 "</TD><TD>"
496                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
497                 "SRC=\"/static/taskmanag_48x.gif\" ALT=\"&nbsp;\">"
498                 "</TD><TD>"
499                 "<B>%s</B><br />"
500                 "%s"
501                 "</TD></TR>\n",
502                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
503                 (ib_tasks ? "CHECKED" : ""),
504                 _("Tasks"),
505                 _("A shortcut to your personal task list")
506         );
507 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
508
509         wprintf("<TR bgcolor=%s><TD>"
510                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_rooms\" VALUE=\"yes\" %s>"
511                 "</TD><TD>"
512                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
513                 "SRC=\"/static/chatrooms_48x.gif\" ALT=\"&nbsp;\">"
514                 "</TD><TD>"
515                 "<B>%s</B><br />"
516                 "%s"
517                 "</TD></TR>\n",
518                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
519                 (ib_rooms ? "CHECKED" : ""),
520                 _("Rooms"),
521                 _("Clicking this icon displays a list of all accesible "
522                 "rooms (or folders) available.")
523         );
524
525         wprintf("<TR bgcolor=%s><TD>"
526                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_users\" VALUE=\"yes\" %s>"
527                 "</TD><TD>"
528                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
529                 "SRC=\"/static/usermanag_48x.gif\" ALT=\"&nbsp;\">"
530                 "</TD><TD>"
531                 "<B>%s</B><br />"
532                 "%s"
533                 "</TD></TR>\n",
534                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
535                 (ib_users ? "CHECKED" : ""),
536                 _("Who is online?"),
537                 _("Clicking this icon displays a list of all users "
538                 "currently logged in.")
539         );
540
541         wprintf("<TR bgcolor=%s><TD>"
542                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_chat\" VALUE=\"yes\" %s>"
543                 "</TD><TD>"
544                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
545                 "SRC=\"/static/citadelchat_48x.gif\" ALT=\"&nbsp;\">"
546                 "</TD><TD>"
547                 "<B>%s</B><br />"
548                 "%s"
549                 "</TD></TR>\n",
550                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
551                 (ib_chat ? "CHECKED" : ""),
552                 _("Chat"),
553                 _("Clicking this icon enters real-time chat mode "
554                 "with other users in the same room.")
555                 
556         );
557
558         wprintf("<TR bgcolor=%s><TD>"
559                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_advanced\" "
560                 "VALUE=\"yes\" %s>"
561                 "</TD><TD>"
562                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
563                 "SRC=\"/static/advanpage2_48x.gif\" ALT=\"&nbsp;\">"
564                 "</TD><TD>"
565                 "<B>%s</B><br />"
566                 "%s"
567                 "</TD></TR>\n",
568                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
569                 (ib_advanced ? "CHECKED" : ""),
570                 _("Advanced options"),
571                 _("Access to the complete menu of Citadel functions.")
572
573         );
574
575         wprintf("<TR bgcolor=%s><TD>"
576                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_citadel\" "
577                 "VALUE=\"yes\" %s>"
578                 "</TD><TD>"
579                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
580                 "SRC=\"/static/citadel-logo.gif\" ALT=\"&nbsp;\">"
581                 "</TD><TD>"
582                 "<B>%s</B><br />"
583                 "%s"
584                 "</TD></TR>\n",
585                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
586                 (ib_citadel ? "CHECKED" : ""),
587                 _("Citadel logo"),
588                 _("Displays the 'Powered by Citadel' icon")
589         );
590
591         wprintf("</TABLE><br />\n"
592                 "<CENTER>"
593                 "<INPUT TYPE=\"submit\" NAME=\"ok_button\" VALUE=\"%s\">"
594                 "&nbsp;"
595                 "<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">"
596                 "</CENTER></FORM>\n",
597                 _("Save changes"),
598                 _("Cancel")
599         );
600
601         wprintf("</td></tr></table></div>\n");
602         wDumpContent(2);
603 }
604
605
606 void commit_iconbar(void) {
607         char iconbar[SIZ];
608         int i;
609
610         char *boxen[] = {
611                 "ib_logo",
612                 "ib_summary",
613                 "ib_inbox",
614                 "ib_calendar",
615                 "ib_contacts",
616                 "ib_notes",
617                 "ib_tasks",
618                 "ib_rooms",
619                 "ib_users",
620                 "ib_chat",
621                 "ib_advanced",
622                 "ib_logoff",
623                 "ib_citadel"
624         };
625
626         if (strlen(bstr("ok_button")) == 0) {
627                 display_main_menu();
628                 return;
629         }
630
631         sprintf(iconbar, "ib_displayas=%d", atoi(bstr("ib_displayas")));
632
633         for (i=0; i<(sizeof(boxen)/sizeof(char *)); ++i) {
634                 sprintf(&iconbar[strlen(iconbar)], ",%s=", boxen[i]);
635                 if (!strcasecmp(bstr(boxen[i]), "yes")) {
636                         sprintf(&iconbar[strlen(iconbar)], "1");
637                 }
638                 else {
639                         sprintf(&iconbar[strlen(iconbar)], "0");
640                 }
641         }
642
643         set_preference("iconbar", iconbar, 1);
644
645         output_headers(1, 1, 0, 0, 0, 0);
646         wprintf(
647                 "<center><table border=1 bgcolor=\"#ffffff\"><tr><td>"
648                 "<IMG SRC=\"/static/advanpage2_48x.gif\">"
649                 "&nbsp;");
650         wprintf(_("Your icon bar has been updated.  Please select any of its "
651                 "choices to continue."));
652         wprintf("</td></tr></table>\n");
653         wDumpContent(2);
654 }