webcit_before_automake is now the trunk
[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         wprintf("<div id=\"button\">\n"
85                 "<ul>\n"
86         );
87
88         if (ib_logo) {
89                 wprintf("<li>");
90                 if (ib_displayas != IB_TEXTONLY) {
91                         wprintf("<IMG BORDER=\"0\" WIDTH=\"120\" "
92                                 "src=\"image&name=hello\" ALT=\"&nbsp;\">\n"
93                         );
94                 }
95                 wprintf("</li>\n");
96         }
97
98         if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
99                 "<li><div align=\"center\">"
100                 "<a href=\"http://www.citadel.org\" "
101                 "title=\"%s\" target=\"aboutcit\">"
102                 "<img border=\"0\" "
103                 "src=\"static/citadel-logo.gif\" ALT=\"%s\"></a>"
104                 "</div></li>\n",
105                 _("Find out more about Citadel"),
106                 _("CITADEL")
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         wprintf("<div id=\"button\">\n"
371                 "<ul>\n"
372         );
373
374         if (ib_logo) {
375                 wprintf("<li>");
376                 if (ib_displayas != IB_TEXTONLY) {
377                         wprintf("<IMG BORDER=\"0\" WIDTH=\"120\" "
378                                 "src=\"image&name=hello\" ALT=\"&nbsp;\">\n"
379                         );
380                 }
381                 wprintf("</li>\n");
382         }
383
384         if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
385                 "<li><div align=\"center\">"
386                 "<a href=\"http://www.citadel.org\" "
387                 "title=\"%s\" target=\"aboutcit\">"
388                 "<img border=\"0\" "
389                 "src=\"static/citadel-logo.gif\" ALT=\"%s\"></a>"
390                 "</div></li>\n",
391                 _("Find out more about Citadel"),
392                 _("CITADEL")
393         );
394
395         wprintf("<li><div align=\"center\"><a href=\"javascript:switch_to_menu_buttons()\">");
396         wprintf(_("switch to menu"));
397         wprintf("</a></div>");
398
399         wprintf("<li>"
400                 "<a href=\"termquit\" TITLE=\"%s\" "
401                 "onClick=\"return confirm('%s');\">",
402                 _("Log off"),
403                 _("Log off now?")
404                 
405         );
406         if (ib_displayas != IB_TEXTONLY) {
407         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
408                 "src=\"static/logoff_32x.gif\">");
409         }
410         if (ib_displayas != IB_PICONLY) {
411                 wprintf(_("Log off"));
412         }
413         wprintf("</A></li>\n");
414
415         wprintf("</ul></div>\n");
416
417         /** embed the room list */
418         list_all_rooms_by_floor("iconbar");
419
420         wprintf("</div>\n");
421 }
422
423
424 /**
425  * \brief display a customized version of the iconbar
426  */
427 void display_customize_iconbar(void) {
428         char iconbar[SIZ];
429         char buf[SIZ];
430         char key[SIZ], value[SIZ];
431         int i;
432         int bar = 0;
433
434         /**
435          * The initialized values of these variables also happen to
436          * specify the default values for users who haven't customized
437          * their iconbars.  These should probably be set in a master
438          * configuration somewhere.
439          */
440         int ib_displayas = IB_PICTEXT;  /**< pictures and text, pictures, text */
441         int ib_logo = 0;        /**< Site logo */
442         int ib_summary = 1;     /**< Summary page icon */
443         int ib_inbox = 1;       /**< Inbox icon */
444         int ib_calendar = 1;    /**< Calendar icon */
445         int ib_contacts = 1;    /**< Contacts icon */
446         int ib_notes = 1;       /**< Notes icon */
447         int ib_tasks = 1;       /**< Tasks icon */
448         int ib_rooms = 1;       /**< Rooms icon */
449         int ib_users = 1;       /**< Users icon */
450         int ib_chat = 1;        /**< Chat icon */
451         int ib_advanced = 1;    /**< Advanced Options icon */
452         int ib_citadel = 1;     /**< 'Powered by Citadel' logo */
453         /*
454          */
455
456         get_preference("iconbar", iconbar, sizeof iconbar);
457         for (i=0; i<num_tokens(iconbar, ','); ++i) {
458                 extract_token(buf, iconbar, i, ',', sizeof buf);
459                 extract_token(key, buf, 0, '=', sizeof key);
460                 extract_token(value, buf, 1, '=', sizeof value);
461
462                 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
463                 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
464                 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
465                 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
466                 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
467                 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
468                 if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
469                 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
470                 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
471                 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
472                 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
473                 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
474                 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
475         }
476
477         output_headers(1, 1, 2, 0, 0, 0);
478         wprintf("<div id=\"banner\">\n"
479                 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
480                 "<SPAN CLASS=\"titlebar\">");
481         wprintf(_("Customize the icon bar"));
482         wprintf("</SPAN>"
483                 "</TD></TR></TABLE>\n"
484                 "</div>\n<div id=\"content\">\n"
485         );
486
487         wprintf("<div class=\"fix_scrollbar_bug\">"
488                 "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>");
489
490         wprintf("<FORM METHOD=\"POST\" action=\"commit_iconbar\">\n");
491
492         wprintf("<CENTER>");
493         wprintf(_("Display icons as:"));
494         wprintf(" ");
495         for (i=0; i<=2; ++i) {
496                 wprintf("<INPUT TYPE=\"radio\" NAME=\"ib_displayas\" VALUE=\"%d\"", i);
497                 if (ib_displayas == i) wprintf(" CHECKED");
498                 wprintf(">");
499                 if (i == IB_PICTEXT)    wprintf(_("pictures and text"));
500                 if (i == IB_PICONLY)    wprintf(_("pictures only"));
501                 if (i == IB_TEXTONLY)   wprintf(_("text only"));
502                 wprintf("\n");
503         }
504         wprintf("<br /><br />\n");
505
506         wprintf(_("Select the icons you would like to see displayed "
507                 "in the 'icon bar' menu on the left side of the "
508                 "screen."));
509         wprintf("</CENTER><br />\n");
510
511         wprintf("<TABLE border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
512
513         wprintf("<TR BGCOLOR=%s><TD>"
514                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_logo\" VALUE=\"yes\" %s>"
515                 "</TD><TD>"
516                 "<IMG BORDER=\"0\" WIDTH=\"48\" "
517                 "src=\"image&name=hello\" ALT=\"&nbsp;\">"
518                 "</TD><TD>"
519                 "<B>%s</B><br />"
520                 "%s"
521                 "</TD></TR>\n",
522                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
523                 (ib_logo ? "CHECKED" : ""),
524                 _("Site logo"),
525                 _("An icon describing this site")
526         );
527
528         wprintf("<TR bgcolor=%s><TD>"
529                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_summary\" VALUE=\"yes\" %s>"
530                 "</TD><TD>"
531                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
532                 "src=\"static/summscreen_48x.gif\" ALT=\"&nbsp;\">"
533                 "</TD><TD>"
534                 "<B>%s</B><br />"
535                 "%s"
536                 "</TD></TR>\n",
537                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
538                 (ib_summary ? "CHECKED" : ""),
539                 _("Summary"),
540                 _("Your summary page")
541         );
542
543         wprintf("<TR bgcolor=%s><TD>"
544                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_inbox\" VALUE=\"yes\" %s>"
545                 "</TD><TD>"
546                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
547                 "src=\"static/privatemess_48x.gif\" ALT=\"&nbsp;\">"
548                 "</TD><TD>"
549                 "<B>%s</B><br />"
550                 "%s"
551                 "</TD></TR>\n",
552                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
553                 (ib_inbox ? "CHECKED" : ""),
554                 _("Mail (inbox)"),
555                 _("A shortcut to your email Inbox")
556         );
557
558         wprintf("<TR bgcolor=%s><TD>"
559                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_contacts\" "
560                 "VALUE=\"yes\" %s>"
561                 "</TD><TD>"
562                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
563                 "src=\"static/viewcontacts_48x.gif\" ALT=\"&nbsp;\">"
564                 "</TD><TD>"
565                 "<B>%s</B><br />"
566                 "%s"
567                 "</TD></TR>\n",
568                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
569                 (ib_contacts ? "CHECKED" : ""),
570                 _("Contacts"),
571                 _("Your personal address book")
572         );
573
574         wprintf("<TR bgcolor=%s><TD>"
575                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_notes\" "
576                 "VALUE=\"yes\" %s>"
577                 "</TD><TD>"
578                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
579                 "src=\"static/storenotes_48x.gif\" ALT=\"&nbsp;\">"
580                 "</TD><TD>"
581                 "<B>%s</B><br />"
582                 "%s"
583                 "</TD></TR>\n",
584                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
585                 (ib_notes ? "CHECKED" : ""),
586                 _("Notes"),
587                 _("Your personal notes")
588         );
589
590 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
591         wprintf("<TR bgcolor=%s><TD>"
592                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_calendar\" "
593                 "VALUE=\"yes\" %s>"
594                 "</TD><TD>"
595                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
596                 "src=\"static/calarea_48x.gif\" ALT=\"&nbsp;\">"
597                 "</TD><TD>"
598                 "<B>%s</B><br />"
599                 "%s"
600                 "</TD></TR>\n",
601                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
602                 (ib_calendar ? "CHECKED" : ""),
603                 _("Calendar"),
604                 _("A shortcut to your personal calendar")
605         );
606
607         wprintf("<TR bgcolor=%s><TD>"
608                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_tasks\" VALUE=\"yes\" %s>"
609                 "</TD><TD>"
610                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
611                 "src=\"static/taskmanag_48x.gif\" ALT=\"&nbsp;\">"
612                 "</TD><TD>"
613                 "<B>%s</B><br />"
614                 "%s"
615                 "</TD></TR>\n",
616                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
617                 (ib_tasks ? "CHECKED" : ""),
618                 _("Tasks"),
619                 _("A shortcut to your personal task list")
620         );
621 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
622
623         wprintf("<TR bgcolor=%s><TD>"
624                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_rooms\" VALUE=\"yes\" %s>"
625                 "</TD><TD>"
626                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
627                 "src=\"static/chatrooms_48x.gif\" ALT=\"&nbsp;\">"
628                 "</TD><TD>"
629                 "<B>%s</B><br />"
630                 "%s"
631                 "</TD></TR>\n",
632                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
633                 (ib_rooms ? "CHECKED" : ""),
634                 _("Rooms"),
635                 _("Clicking this icon displays a list of all accessible "
636                 "rooms (or folders) available.")
637         );
638
639         wprintf("<TR bgcolor=%s><TD>"
640                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_users\" VALUE=\"yes\" %s>"
641                 "</TD><TD>"
642                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
643                 "src=\"static/usermanag_48x.gif\" ALT=\"&nbsp;\">"
644                 "</TD><TD>"
645                 "<B>%s</B><br />"
646                 "%s"
647                 "</TD></TR>\n",
648                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
649                 (ib_users ? "CHECKED" : ""),
650                 _("Who is online?"),
651                 _("Clicking this icon displays a list of all users "
652                 "currently logged in.")
653         );
654
655         wprintf("<TR bgcolor=%s><TD>"
656                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_chat\" VALUE=\"yes\" %s>"
657                 "</TD><TD>"
658                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
659                 "src=\"static/citadelchat_48x.gif\" ALT=\"&nbsp;\">"
660                 "</TD><TD>"
661                 "<B>%s</B><br />"
662                 "%s"
663                 "</TD></TR>\n",
664                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
665                 (ib_chat ? "CHECKED" : ""),
666                 _("Chat"),
667                 _("Clicking this icon enters real-time chat mode "
668                 "with other users in the same room.")
669                 
670         );
671
672         wprintf("<TR bgcolor=%s><TD>"
673                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_advanced\" "
674                 "VALUE=\"yes\" %s>"
675                 "</TD><TD>"
676                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
677                 "src=\"static/advanpage2_48x.gif\" ALT=\"&nbsp;\">"
678                 "</TD><TD>"
679                 "<B>%s</B><br />"
680                 "%s"
681                 "</TD></TR>\n",
682                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
683                 (ib_advanced ? "CHECKED" : ""),
684                 _("Advanced options"),
685                 _("Access to the complete menu of Citadel functions.")
686
687         );
688
689         wprintf("<TR bgcolor=%s><TD>"
690                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_citadel\" "
691                 "VALUE=\"yes\" %s>"
692                 "</TD><TD>"
693                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
694                 "src=\"static/citadel-logo.gif\" ALT=\"&nbsp;\">"
695                 "</TD><TD>"
696                 "<B>%s</B><br />"
697                 "%s"
698                 "</TD></TR>\n",
699                 ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
700                 (ib_citadel ? "CHECKED" : ""),
701                 _("Citadel logo"),
702                 _("Displays the 'Powered by Citadel' icon")
703         );
704
705         wprintf("</TABLE><br />\n"
706                 "<CENTER>"
707                 "<INPUT TYPE=\"submit\" NAME=\"ok_button\" VALUE=\"%s\">"
708                 "&nbsp;"
709                 "<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">"
710                 "</CENTER></FORM>\n",
711                 _("Save changes"),
712                 _("Cancel")
713         );
714
715         wprintf("</td></tr></table></div>\n");
716         wDumpContent(2);
717 }
718
719 /**
720  * \brief commit the changes of an edited iconbar ????
721  */
722 void commit_iconbar(void) {
723         char iconbar[SIZ];
724         int i;
725
726         char *boxen[] = {
727                 "ib_logo",
728                 "ib_summary",
729                 "ib_inbox",
730                 "ib_calendar",
731                 "ib_contacts",
732                 "ib_notes",
733                 "ib_tasks",
734                 "ib_rooms",
735                 "ib_users",
736                 "ib_chat",
737                 "ib_advanced",
738                 "ib_logoff",
739                 "ib_citadel"
740         };
741
742         if (strlen(bstr("ok_button")) == 0) {
743                 display_main_menu();
744                 return;
745         }
746
747         sprintf(iconbar, "ib_displayas=%d", atoi(bstr("ib_displayas")));
748
749         for (i=0; i<(sizeof(boxen)/sizeof(char *)); ++i) {
750                 sprintf(&iconbar[strlen(iconbar)], ",%s=", boxen[i]);
751                 if (!strcasecmp(bstr(boxen[i]), "yes")) {
752                         sprintf(&iconbar[strlen(iconbar)], "1");
753                 }
754                 else {
755                         sprintf(&iconbar[strlen(iconbar)], "0");
756                 }
757         }
758
759         set_preference("iconbar", iconbar, 1);
760
761         output_headers(1, 1, 0, 0, 0, 0);
762         wprintf(
763                 "<center><table border=1 bgcolor=\"#ffffff\"><tr><td>"
764                 "<img src=\"static/advanpage2_48x.gif\">"
765                 "&nbsp;");
766         wprintf(_("Your icon bar has been updated.  Please select any of its "
767                 "choices to continue."));
768         wprintf("</td></tr></table>\n");
769         wDumpContent(2);
770 }
771
772
773
774 /*@}*/