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