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