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