Cleaning code of the left side bar...
[citadel.git] / webcit / iconbar.c
1 /*
2  * $Id$
3  */
4 /**
5  * \defgroup IconBar Displays and customizes the iconbar.
6  * \ingroup MenuInfrastructure
7  */
8 /*@{*/
9 #include "webcit.h"
10
11
12 /** Values for ib_displayas */
13 #define IB_PICTEXT      0 /**< picture and text */
14 #define IB_PICONLY      1 /**< just a picture */
15 #define IB_TEXTONLY     2 /**< just text */
16
17
18 /**
19  * \brief draw the icon bar?????
20  */
21 void do_selected_iconbar(void) {
22         if (WC->current_iconbar == current_iconbar_roomlist) {
23                 do_iconbar_roomlist();
24         }
25         else {
26                 do_iconbar();
27         }
28 }
29
30 /**
31  * \brief draw the icon bar???
32  */
33 void do_iconbar(void) {
34         char iconbar[SIZ];
35         char buf[SIZ];
36         char key[SIZ], value[SIZ];
37         int i;
38
39         WC->current_iconbar = current_iconbar_menu;
40
41         /**
42          * The initialized values of these variables also happen to
43          * specify the default values for users who haven't customized
44          * their iconbars.  These should probably be set in a master
45          * configuration somewhere.
46          */
47         int ib_displayas = 0;   /**< pictures and text, pictures, text */
48         int ib_logo = 0;        /**< Site logo */
49         int ib_summary = 1;     /**< Summary page icon */
50         int ib_inbox = 1;       /**< Inbox icon */
51         int ib_calendar = 1;    /**< Calendar icon */
52         int ib_contacts = 1;    /**< Contacts icon */
53         int ib_notes = 1;       /**< Notes icon */
54         int ib_tasks = 1;       /**< Tasks icon */
55         int ib_rooms = 1;       /**< Rooms icon */
56         int ib_users = 1;       /**< Users icon */
57         int ib_chat = 1;        /**< Chat icon */
58         int ib_advanced = 1;    /**< Advanced Options icon */
59         int ib_citadel = 1;     /**< 'Powered by Citadel' logo */
60         /*
61          */
62
63         get_preference("iconbar", iconbar, sizeof iconbar);
64         for (i=0; i<num_tokens(iconbar, ','); ++i) {
65                 extract_token(buf, iconbar, i, ',', sizeof buf);
66                 extract_token(key, buf, 0, '=', sizeof key);
67                 extract_token(value, buf, 1, '=', sizeof value);
68
69                 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
70                 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
71                 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
72                 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
73                 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
74                 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
75                 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
76                 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
77                 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
78                 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
79                 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
80                 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
81                 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
82         }
83
84         if (ib_logo) {
85                 if (ib_displayas != IB_TEXTONLY) {
86                         wprintf("<div class=\"logo\"> <img "
87                                 "src=\"image&name=hello\" alt=\"&nbsp;\"> "
88                                 "</div>\n"
89                         );
90                 }
91                 wprintf("\n");
92         }
93
94         if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
95                 "<div class=\"logo_citadel\"> "
96                 "<a href=\"http://www.citadel.org\" "
97                 "title=\"%s\" target=\"aboutcit\"> "
98                 "<img "
99                 "src=\"static/citadel-logo.gif\" alt=\"%s\"></a> "
100                 "</div>\n",
101                 _("Find out more about Citadel"),
102                 _("CITADEL")
103         );
104
105         wprintf("<ul id=\"button\">\n");
106
107         wprintf("<li class=\"switch\"><a href=\"javascript:switch_to_room_list()\">");
108         wprintf(_("switch to room list"));
109         wprintf("</a></li>");
110
111         if (ib_summary) {
112                 wprintf("<li><a href=\"summary\" "
113                         "title=\"%s\" "
114                         ">", _("Your summary page")
115                 );
116                 if (ib_displayas != IB_TEXTONLY) {
117                         wprintf("<img border=\"0\" width=\"32\" height=\"32\" "
118                                 "src=\"static/summscreen_32x.gif\">");
119                 }
120                 if (ib_displayas != IB_PICONLY) {
121                         wprintf(_("Summary"));
122                 }
123                 wprintf("</a></li>\n");
124         }
125
126         if (ib_inbox) {
127                 wprintf("<li>"
128                         "<a href=\"dotgoto?room=_MAIL_\" "
129                         "title=\"%s\" "
130                         ">",
131                         _("Go to your email inbox")
132                 );
133                 if (ib_displayas != IB_TEXTONLY) {
134                         wprintf("<img border=\"0\" width=\"32\" height=\"32\" "
135                                 "src=\"static/privatemess_32x.gif\">");
136                 }
137                 if (ib_displayas != IB_PICONLY) {
138                         wprintf(_("Mail"));
139                         if (WC->new_mail != WC->remember_new_mail) {
140 /*
141                                 if (WC->new_mail > 0) {
142                                         wprintf(" <b>(%d)</b>", WC->new_mail);
143                                 }
144 */
145                                 WC->remember_new_mail = WC->new_mail;
146                         }
147                 }
148                 wprintf("</a></li>\n");
149         }
150
151         if (ib_calendar) {
152                 wprintf("<li>"
153                         "<a href=\"dotgoto?room=_CALENDAR_\" "
154                         "title=\"%s\" "
155                         ">",
156                         _("Go to your personal calendar")
157                 );
158                 if (ib_displayas != IB_TEXTONLY) {
159                         wprintf("<img border=\"0\" width=\"32\" height=\"32\" "
160                         "src=\"static/calarea_32x.gif\">");
161                 }
162                 if (ib_displayas != IB_PICONLY) {
163                         wprintf(_("Calendar"));
164                 }
165                 wprintf("</a></li>\n");
166         }
167
168         if (ib_contacts) {
169                 wprintf("<li>"
170                         "<a href=\"dotgoto?room=_CONTACTS_\" "
171                         "title=\"%s\" "
172                         ">",
173                         _("Go to your personal address book")
174                 );
175                 if (ib_displayas != IB_TEXTONLY) {
176                         wprintf("<img border=\"0\" width=\"32\" height=\"32\" "
177                         "src=\"static/viewcontacts_32x.gif\">");
178                 }
179                 if (ib_displayas != IB_PICONLY) {
180                         wprintf(_("Contacts"));
181                 }
182                 wprintf("</a></li>\n");
183         }
184
185         if (ib_notes) {
186                 wprintf("<li>"
187                         "<a href=\"dotgoto?room=_NOTES_\" "
188                         "title=\"%s\" "
189                         ">",
190                         _("Go to your personal notes")
191                 );
192                 if (ib_displayas != IB_TEXTONLY) {
193                         wprintf("<img border=\"0\" width=\"32\" height=\"32\" "
194                         "src=\"static/storenotes_32x.gif\">");
195                 }
196                 if (ib_displayas != IB_PICONLY) {
197                         wprintf(_("Notes"));
198                 }
199                 wprintf("</a></li>\n");
200         }
201
202         if (ib_tasks)  {
203                 wprintf("<li>"
204                         "<a href=\"dotgoto?room=_TASKS_\" "
205                         "title=\"%s\" "
206                         ">",
207                         _("Go to your personal task list")
208                 );
209                 if (ib_displayas != IB_TEXTONLY) {
210                         wprintf("<img border=\"0\" width=\"32\" height=\"32\" "
211                         "src=\"static/taskmanag_32x.gif\">");
212                 }
213                 if (ib_displayas != IB_PICONLY) {
214                         wprintf(_("Tasks"));
215                 }
216                 wprintf("</a></li>\n");
217         }
218
219         if (ib_rooms) {
220                 wprintf("<li>"
221                         "<a href=\"knrooms\" title=\"%s\" >",
222                         _("List all of your accessible rooms")
223                 );
224                 if (ib_displayas != IB_TEXTONLY) {
225                         wprintf("<img border=\"0\" width=\"32\" height=\"32\" "
226                         "src=\"static/chatrooms_32x.gif\">");
227                 }
228                 if (ib_displayas != IB_PICONLY) {
229                         wprintf(_("Rooms"));
230                 }
231                 wprintf("</a></li>\n");
232         }
233
234         if (ib_users) {
235                 wprintf("<li>"
236                         "<a href=\"who\" title=\"%s\" "
237                         ">",
238                         _("See who is online right now")
239                 );
240                 if (ib_displayas != IB_TEXTONLY) {
241                         wprintf("<img border=\"0\" width=\"32\" height=\"32\" "
242                         "src=\"static/usermanag_32x.gif\">");
243                 }
244                 if (ib_displayas != IB_PICONLY) {
245                         wprintf(_("Who is online?"));
246                 }
247                 wprintf("</a></li>\n");
248         }
249
250         if (ib_chat) {
251                 wprintf("<li>"
252                         "<a href=\"#\" onClick=\"window.open('chat', "
253                         "'ctdl_chat_window', "
254                         "'toolbar=no,location=no,directories=no,copyhistory=no,"
255                         "status=no,scrollbars=yes,resizable=yes');\""
256                         ">"
257                 );
258                 if (ib_displayas != IB_TEXTONLY) {
259                         wprintf("<img border=\"0\" width=\"32\" height=\"32\" "
260                         "src=\"static/citadelchat_32x.gif\">");
261                 }
262                 if (ib_displayas != IB_PICONLY) {
263                         wprintf(_("Chat"));
264                 }
265                 wprintf("</a></li>\n");
266         }
267
268         if (ib_advanced) {
269                 wprintf("<li>"
270                         "<a href=\"display_main_menu\" "
271                         "title=\"%s\" "
272                         ">",
273                         _("Advanced Options Menu: Advanced Room commands, Account Info, and Chat")
274                 );
275                 if (ib_displayas != IB_TEXTONLY) {
276                         wprintf("<img border=\"0\" width=\"32\" height=\"32\" "
277                         "src=\"static/advanpage2_32x.gif\">");
278                 }
279                 if (ib_displayas != IB_PICONLY) {
280                         wprintf(_("Advanced"));
281                 }
282                 wprintf("</a></li>\n");
283         }
284
285         if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
286                 wprintf("<li>"
287                         "<a href=\"display_aide_menu\" "
288                         "title=\"%s\" "
289                         ">",
290                         _("Room and system administration functions")
291                 );
292                 if (ib_displayas != IB_TEXTONLY) {
293                         wprintf("<img border=\"0\" width=\"32\" height=\"32\" "
294                         "src=\"static/advanpage2_32x.gif\">");
295                 }
296                 if (ib_displayas != IB_PICONLY) {
297                         wprintf(_("Administration"));
298                 }
299                 wprintf("</a></li>\n");
300         }
301
302         wprintf("<li>"
303                 "<a href=\"termquit\" title=\"%s\" "
304                 "onClick=\"return confirm('%s');\">",
305                 _("Log off"),
306                 _("Log off now?")
307                 
308         );
309         if (ib_displayas != IB_TEXTONLY) {
310         wprintf("<img border=\"0\" width=\"32\" height=\"32\" "
311                 "src=\"static/logoff_32x.gif\">");
312         }
313         if (ib_displayas != IB_PICONLY) {
314                 wprintf(_("Log off"));
315         }
316         wprintf("</a></li>\n");
317
318         wprintf(
319                 "<li class=\"switch\">"
320                 "<a href=\"display_customize_iconbar\" "
321                 "title=\"%s\" "
322                 ">%s"
323                 "</a></li>\n",
324                 _("Customize this menu"),
325                 _("customize this menu")
326         );
327
328         wprintf("</ul>\n");
329 }
330
331
332 /**
333  * \brief roomtree view of the iconbar
334  * If the user has toggled the icon bar over to a room list, here's where
335  * we generate its innerHTML...
336  */
337 void do_iconbar_roomlist(void) {
338         char iconbar[SIZ];
339         char buf[SIZ];
340         char key[SIZ], value[SIZ];
341         int i;
342
343         WC->current_iconbar = current_iconbar_roomlist;
344
345         /**
346          * The initialized values of these variables also happen to
347          * specify the default values for users who haven't customized
348          * their iconbars.  These should probably be set in a master
349          * configuration somewhere.
350          */
351         int ib_displayas = 0;   /* pictures and text, pictures, text */
352         int ib_logo = 0;        /* Site logo */
353         int ib_citadel = 1;     /* 'Powered by Citadel' logo */
354         /*
355          */
356
357         get_preference("iconbar", iconbar, sizeof iconbar);
358         for (i=0; i<num_tokens(iconbar, ','); ++i) {
359                 extract_token(buf, iconbar, i, ',', sizeof buf);
360                 extract_token(key, buf, 0, '=', sizeof key);
361                 extract_token(value, buf, 1, '=', sizeof value);
362
363                 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
364                 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
365                 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
366         }
367
368         if (ib_logo) {
369                 if (ib_displayas != IB_TEXTONLY) {
370                         wprintf("<div class=\"logo\"> <img "
371                                 "src=\"image&name=hello\" alt=\"&nbsp;\"> "
372                                 "</div>\n"
373                         );
374                 }
375         }
376
377         if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
378                 "<div class=\"logo_citadel\"> "
379                 "<a href=\"http://www.citadel.org\" "
380                 "title=\"%s\" target=\"aboutcit\"> "
381                 "<img "
382                 "src=\"static/citadel-logo.gif\" alt=\"%s\"></a> "
383                 "</div>\n",
384                 _("Find out more about Citadel"),
385                 _("CITADEL")
386         );
387
388         wprintf("<ul id=\"button\">\n");
389
390         wprintf("<li class=\"switch\"><a href=\"javascript:switch_to_menu_buttons()\">");
391         wprintf(_("switch to menu"));
392         wprintf("</a></li>");
393
394         wprintf("<li>"
395                 "<a href=\"termquit\" title=\"%s\" "
396                 "onClick=\"return confirm('%s');\">",
397                 _("Log off"),
398                 _("Log off now?")
399                 
400         );
401         if (ib_displayas != IB_TEXTONLY) {
402         wprintf("<img border=\"0\" width=\"32\" height=\"32\" "
403                 "src=\"static/logoff_32x.gif\">");
404         }
405         if (ib_displayas != IB_PICONLY) {
406                 wprintf(_("Log off"));
407         }
408         wprintf("</a></li>\n");
409
410         wprintf("</ul>\n");
411
412         /** embed the room list */
413         list_all_rooms_by_floor("iconbar");
414
415         wprintf("</div>\n");
416 }
417
418
419 /**
420  * \brief display a customized version of the iconbar
421  */
422 void display_customize_iconbar(void) {
423         char iconbar[SIZ];
424         char buf[SIZ];
425         char key[SIZ], value[SIZ];
426         int i;
427         int bar = 0;
428
429         /**
430          * The initialized values of these variables also happen to
431          * specify the default values for users who haven't customized
432          * their iconbars.  These should probably be set in a master
433          * configuration somewhere.
434          */
435         int ib_displayas = IB_PICTEXT;  /**< pictures and text, pictures, text */
436         int ib_logo = 0;        /**< Site logo */
437         int ib_summary = 1;     /**< Summary page icon */
438         int ib_inbox = 1;       /**< Inbox icon */
439         int ib_calendar = 1;    /**< Calendar icon */
440         int ib_contacts = 1;    /**< Contacts icon */
441         int ib_notes = 1;       /**< Notes icon */
442         int ib_tasks = 1;       /**< Tasks icon */
443         int ib_rooms = 1;       /**< Rooms icon */
444         int ib_users = 1;       /**< Users icon */
445         int ib_chat = 1;        /**< Chat icon */
446         int ib_advanced = 1;    /**< Advanced Options icon */
447         int ib_citadel = 1;     /**< 'Powered by Citadel' logo */
448         /*
449          */
450
451         get_preference("iconbar", iconbar, sizeof iconbar);
452         for (i=0; i<num_tokens(iconbar, ','); ++i) {
453                 extract_token(buf, iconbar, i, ',', sizeof buf);
454                 extract_token(key, buf, 0, '=', sizeof key);
455                 extract_token(value, buf, 1, '=', sizeof value);
456
457                 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
458                 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
459                 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
460                 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
461                 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
462                 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
463                 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
464                 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
465                 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
466                 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
467                 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
468                 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
469                 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
470         }
471
472         output_headers(1, 1, 2, 0, 0, 0);
473         wprintf("<div id=\"banner\">\n"
474                 "<TABLE class=\"iconbar_banner\"><tr><td>"
475                 "<SPAN CLASS=\"titlebar\">");
476         wprintf(_("Customize the icon bar"));
477         wprintf("</SPAN>"
478                 "</td></tr></table>\n"
479                 "</div>\n<div id=\"content\">\n"
480         );
481
482         wprintf("<div class=\"fix_scrollbar_bug\">"
483                 "<table class=\"iconbar_background\"><tr><td>");
484
485         wprintf("<FORM METHOD=\"POST\" action=\"commit_iconbar\">\n");
486
487         wprintf("<CENTER>");
488         wprintf(_("Display icons as:"));
489         wprintf(" ");
490         for (i=0; i<=2; ++i) {
491                 wprintf("<input type=\"radio\" name=\"ib_displayas\" value=\"%d\"", i);
492                 if (ib_displayas == i) wprintf(" CHECKED");
493                 wprintf(">");
494                 if (i == IB_PICTEXT)    wprintf(_("pictures and text"));
495                 if (i == IB_PICONLY)    wprintf(_("pictures only"));
496                 if (i == IB_TEXTONLY)   wprintf(_("text only"));
497                 wprintf("\n");
498         }
499         wprintf("<br /><br />\n");
500
501         wprintf(_("Select the icons you would like to see displayed "
502                 "in the 'icon bar' menu on the left side of the "
503                 "screen."));
504         wprintf("</CENTER><br />\n");
505
506         wprintf("<TABLE border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
507
508         wprintf("<tr BGCOLOR=%s><td>"
509                 "<input type=\"checkbox\" name=\"ib_logo\" value=\"yes\" %s>"
510                 "</td><td>"
511                 "<img border=\"0\" width=\"48\" "
512                 "src=\"image&name=hello\" alt=\"&nbsp;\">"
513                 "</td><td>"
514                 "<b>%s</b><br />"
515                 "%s"
516                 "</td></tr>\n",
517                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
518                 (ib_logo ? "CHECKED" : ""),
519                 _("Site logo"),
520                 _("An icon describing this site")
521         );
522
523         wprintf("<tr bgcolor=%s><td>"
524                 "<input type=\"checkbox\" name=\"ib_summary\" value=\"yes\" %s>"
525                 "</td><td>"
526                 "<img border=\"0\" width=\"48\" height=\"48\" "
527                 "src=\"static/summscreen_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_summary ? "CHECKED" : ""),
534                 _("Summary"),
535                 _("Your summary page")
536         );
537
538         wprintf("<tr bgcolor=%s><td>"
539                 "<input type=\"checkbox\" name=\"ib_inbox\" value=\"yes\" %s>"
540                 "</td><td>"
541                 "<img border=\"0\" width=\"48\" height=\"48\" "
542                 "src=\"static/privatemess_48x.gif\" alt=\"&nbsp;\">"
543                 "</td><td>"
544                 "<b>%s</b><br />"
545                 "%s"
546                 "</td></tr>\n",
547                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
548                 (ib_inbox ? "CHECKED" : ""),
549                 _("Mail (inbox)"),
550                 _("A shortcut to your email Inbox")
551         );
552
553         wprintf("<tr bgcolor=%s><td>"
554                 "<input type=\"checkbox\" name=\"ib_contacts\" "
555                 "value=\"yes\" %s>"
556                 "</td><td>"
557                 "<img border=\"0\" width=\"48\" height=\"48\" "
558                 "src=\"static/viewcontacts_48x.gif\" alt=\"&nbsp;\">"
559                 "</td><td>"
560                 "<b>%s</b><br />"
561                 "%s"
562                 "</td></tr>\n",
563                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
564                 (ib_contacts ? "CHECKED" : ""),
565                 _("Contacts"),
566                 _("Your personal address book")
567         );
568
569         wprintf("<tr bgcolor=%s><td>"
570                 "<input type=\"checkbox\" name=\"ib_notes\" "
571                 "value=\"yes\" %s>"
572                 "</td><td>"
573                 "<img border=\"0\" width=\"48\" height=\"48\" "
574                 "src=\"static/storenotes_48x.gif\" alt=\"&nbsp;\">"
575                 "</td><td>"
576                 "<b>%s</b><br />"
577                 "%s"
578                 "</td></tr>\n",
579                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
580                 (ib_notes ? "CHECKED" : ""),
581                 _("Notes"),
582                 _("Your personal notes")
583         );
584
585 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
586         wprintf("<tr bgcolor=%s><td>"
587                 "<input type=\"checkbox\" name=\"ib_calendar\" "
588                 "value=\"yes\" %s>"
589                 "</td><td>"
590                 "<img border=\"0\" width=\"48\" height=\"48\" "
591                 "src=\"static/calarea_48x.gif\" alt=\"&nbsp;\">"
592                 "</td><td>"
593                 "<b>%s</b><br />"
594                 "%s"
595                 "</td></tr>\n",
596                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
597                 (ib_calendar ? "CHECKED" : ""),
598                 _("Calendar"),
599                 _("A shortcut to your personal calendar")
600         );
601
602         wprintf("<tr bgcolor=%s><td>"
603                 "<input type=\"checkbox\" name=\"ib_tasks\" value=\"yes\" %s>"
604                 "</td><td>"
605                 "<img border=\"0\" width=\"48\" height=\"48\" "
606                 "src=\"static/taskmanag_48x.gif\" alt=\"&nbsp;\">"
607                 "</td><td>"
608                 "<b>%s</b><br />"
609                 "%s"
610                 "</td></tr>\n",
611                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
612                 (ib_tasks ? "CHECKED" : ""),
613                 _("Tasks"),
614                 _("A shortcut to your personal task list")
615         );
616 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
617
618         wprintf("<tr bgcolor=%s><td>"
619                 "<input type=\"checkbox\" name=\"ib_rooms\" value=\"yes\" %s>"
620                 "</td><td>"
621                 "<img border=\"0\" width=\"48\" height=\"48\" "
622                 "src=\"static/chatrooms_48x.gif\" alt=\"&nbsp;\">"
623                 "</td><td>"
624                 "<b>%s</b><br />"
625                 "%s"
626                 "</td></tr>\n",
627                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
628                 (ib_rooms ? "CHECKED" : ""),
629                 _("Rooms"),
630                 _("Clicking this icon displays a list of all accessible "
631                 "rooms (or folders) available.")
632         );
633
634         wprintf("<tr bgcolor=%s><td>"
635                 "<input type=\"checkbox\" name=\"ib_users\" value=\"yes\" %s>"
636                 "</td><td>"
637                 "<img border=\"0\" width=\"48\" height=\"48\" "
638                 "src=\"static/usermanag_48x.gif\" alt=\"&nbsp;\">"
639                 "</td><td>"
640                 "<b>%s</b><br />"
641                 "%s"
642                 "</td></tr>\n",
643                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
644                 (ib_users ? "CHECKED" : ""),
645                 _("Who is online?"),
646                 _("Clicking this icon displays a list of all users "
647                 "currently logged in.")
648         );
649
650         wprintf("<tr bgcolor=%s><td>"
651                 "<input type=\"checkbox\" name=\"ib_chat\" value=\"yes\" %s>"
652                 "</td><td>"
653                 "<img border=\"0\" width=\"48\" height=\"48\" "
654                 "src=\"static/citadelchat_48x.gif\" alt=\"&nbsp;\">"
655                 "</td><td>"
656                 "<b>%s</b><br />"
657                 "%s"
658                 "</td></tr>\n",
659                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
660                 (ib_chat ? "CHECKED" : ""),
661                 _("Chat"),
662                 _("Clicking this icon enters real-time chat mode "
663                 "with other users in the same room.")
664                 
665         );
666
667         wprintf("<tr bgcolor=%s><td>"
668                 "<input type=\"checkbox\" name=\"ib_advanced\" "
669                 "value=\"yes\" %s>"
670                 "</td><td>"
671                 "<img border=\"0\" width=\"48\" height=\"48\" "
672                 "src=\"static/advanpage2_48x.gif\" alt=\"&nbsp;\">"
673                 "</td><td>"
674                 "<b>%s</b><br />"
675                 "%s"
676                 "</td></tr>\n",
677                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
678                 (ib_advanced ? "CHECKED" : ""),
679                 _("Advanced options"),
680                 _("Access to the complete menu of Citadel functions.")
681
682         );
683
684         wprintf("<tr bgcolor=%s><td>"
685                 "<input type=\"checkbox\" name=\"ib_citadel\" "
686                 "value=\"yes\" %s>"
687                 "</td><td>"
688                 "<img border=\"0\" width=\"48\" height=\"48\" "
689                 "src=\"static/citadel-logo.gif\" alt=\"&nbsp;\">"
690                 "</td><td>"
691                 "<b>%s</b><br />"
692                 "%s"
693                 "</td></tr>\n",
694                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
695                 (ib_citadel ? "CHECKED" : ""),
696                 _("Citadel logo"),
697                 _("Displays the 'Powered by Citadel' icon")
698         );
699
700         wprintf("</table><br />\n"
701                 "<CENTER>"
702                 "<input type=\"submit\" name=\"ok_button\" value=\"%s\">"
703                 "&nbsp;"
704                 "<input type=\"submit\" name=\"cancel_button\" value=\"%s\">"
705                 "</CENTER></FORM>\n",
706                 _("Save changes"),
707                 _("Cancel")
708         );
709
710         wprintf("</td></tr></table></div>\n");
711         wDumpContent(2);
712 }
713
714 /**
715  * \brief commit the changes of an edited iconbar ????
716  */
717 void commit_iconbar(void) {
718         char iconbar[SIZ];
719         int i;
720
721         char *boxen[] = {
722                 "ib_logo",
723                 "ib_summary",
724                 "ib_inbox",
725                 "ib_calendar",
726                 "ib_contacts",
727                 "ib_notes",
728                 "ib_tasks",
729                 "ib_rooms",
730                 "ib_users",
731                 "ib_chat",
732                 "ib_advanced",
733                 "ib_logoff",
734                 "ib_citadel"
735         };
736
737         if (strlen(bstr("ok_button")) == 0) {
738                 display_main_menu();
739                 return;
740         }
741
742         sprintf(iconbar, "ib_displayas=%d", atoi(bstr("ib_displayas")));
743
744         for (i=0; i<(sizeof(boxen)/sizeof(char *)); ++i) {
745                 sprintf(&iconbar[strlen(iconbar)], ",%s=", boxen[i]);
746                 if (!strcasecmp(bstr(boxen[i]), "yes")) {
747                         sprintf(&iconbar[strlen(iconbar)], "1");
748                 }
749                 else {
750                         sprintf(&iconbar[strlen(iconbar)], "0");
751                 }
752         }
753
754         set_preference("iconbar", iconbar, 1);
755
756         output_headers(1, 1, 0, 0, 0, 0);
757         wprintf(
758                 "<center><table border=1 bgcolor=\"#ffffff\"><tr><td>"
759                 "<img src=\"static/advanpage2_48x.gif\">"
760                 "&nbsp;");
761         wprintf(_("Your icon bar has been updated.  Please select any of its "
762                 "choices to continue."));
763         wprintf("</td></tr></table>\n");
764         wDumpContent(2);
765 }
766
767
768
769 /*@}*/