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