Began making changes to do better handling of character sets.
[citadel.git] / webcit / iconbar.c
index f656a5191e330c562e2bac367896089f46056bff..bb9a4e41711258f5f0b71dc456fc38ea21b194c6 100644 (file)
@@ -1,42 +1,62 @@
 /*
  * $Id$
- *
- * Displays and customizes the iconbar.
  */
-
+/**
+ * \defgroup IconBar Displays and customizes the iconbar.
+ * \ingroup MenuInfrastructure
+ */
+/*@{*/
 #include "webcit.h"
 
 
-/* Values for ib_displayas */
-#define IB_PICTEXT     0
-#define IB_PICONLY     1
-#define IB_TEXTONLY    2
+/** Values for ib_displayas */
+#define IB_PICTEXT     0 /**< picture and text */
+#define IB_PICONLY     1 /**< just a picture */
+#define IB_TEXTONLY    2 /**< just text */
 
 
+/**
+ * \brief draw the icon bar?????
+ */
+void do_selected_iconbar(void) {
+       if (WC->current_iconbar == current_iconbar_roomlist) {
+               do_iconbar_roomlist();
+       }
+       else {
+               do_iconbar();
+       }
+}
+
+/**
+ * \brief draw the icon bar???
+ */
 void do_iconbar(void) {
        char iconbar[SIZ];
        char buf[SIZ];
        char key[SIZ], value[SIZ];
        int i;
 
-       /* The initialized values of these variables also happen to
+       WC->current_iconbar = current_iconbar_menu;
+
+       /**
+        * The initialized values of these variables also happen to
         * specify the default values for users who haven't customized
         * their iconbars.  These should probably be set in a master
         * configuration somewhere.
         */
-       int ib_displayas = 0;   /* pictures and text, pictures, text */
-       int ib_logo = 0;        /* Site logo */
-       int ib_summary = 1;     /* Summary page icon */
-       int ib_inbox = 1;       /* Inbox icon */
-       int ib_calendar = 1;    /* Calendar icon */
-       int ib_contacts = 1;    /* Contacts icon */
-       int ib_notes = 1;       /* Notes icon */
-       int ib_tasks = 1;       /* Tasks icon */
-       int ib_rooms = 1;       /* Rooms icon */
-       int ib_users = 1;       /* Users icon */
-       int ib_chat = 1;        /* Chat icon */
-       int ib_advanced = 1;    /* Advanced Options icon */
-       int ib_citadel = 1;     /* 'Powered by Citadel' logo */
+       int ib_displayas = 0;   /**< pictures and text, pictures, text */
+       int ib_logo = 0;        /**< Site logo */
+       int ib_summary = 1;     /**< Summary page icon */
+       int ib_inbox = 1;       /**< Inbox icon */
+       int ib_calendar = 1;    /**< Calendar icon */
+       int ib_contacts = 1;    /**< Contacts icon */
+       int ib_notes = 1;       /**< Notes icon */
+       int ib_tasks = 1;       /**< Tasks icon */
+       int ib_rooms = 1;       /**< Rooms icon */
+       int ib_users = 1;       /**< Users icon */
+       int ib_chat = 1;        /**< Chat icon */
+       int ib_advanced = 1;    /**< Advanced Options icon */
+       int ib_citadel = 1;     /**< 'Powered by Citadel' logo */
        /*
         */
 
@@ -86,10 +106,9 @@ void do_iconbar(void) {
                _("CITADEL")
        );
 
-       wprintf("<li><div align=\"center\">"
-               "<a href=\"javascript:switch_to_room_list()\">switch to room list</a>"
-               "</div>"
-       );
+       wprintf("<li><div align=\"center\"><a href=\"javascript:switch_to_room_list()\">");
+       wprintf(_("switch to room list"));
+       wprintf("</a></div>");
 
        if (ib_summary) {
                wprintf("<li><a href=\"summary\" "
@@ -282,23 +301,21 @@ void do_iconbar(void) {
                wprintf("</A></li>\n");
        }
 
-       if (1) {
-               wprintf("<li>"
-                       "<a href=\"termquit\" TITLE=\"%s\" "
-                       "onClick=\"return confirm('%s');\">",
-                       _("Log off"),
-                       _("Log off now?")
-                       
-               );
-               if (ib_displayas != IB_TEXTONLY) {
-               wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
-                       "src=\"static/logoff_32x.gif\">");
-               }
-               if (ib_displayas != IB_PICONLY) {
-                       wprintf(_("Log off"));
-               }
-               wprintf("</A></li>\n");
+       wprintf("<li>"
+               "<a href=\"termquit\" TITLE=\"%s\" "
+               "onClick=\"return confirm('%s');\">",
+               _("Log off"),
+               _("Log off now?")
+               
+       );
+       if (ib_displayas != IB_TEXTONLY) {
+       wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
+               "src=\"static/logoff_32x.gif\">");
        }
+       if (ib_displayas != IB_PICONLY) {
+               wprintf(_("Log off"));
+       }
+       wprintf("</A></li>\n");
 
        wprintf(
                "<li><div align=\"center\">"
@@ -310,19 +327,12 @@ void do_iconbar(void) {
                _("customize this menu")
        );
 
-       wprintf("</ul>\n");
-
-       /*
-       wprintf("<div id=\"dropstuff\" style=\"font-size:6pt\">");
-       wprintf("Drag to trash here...<br>");
-       wprintf("</div>");
-       */
-
-       wprintf("</div>\n");
+       wprintf("</ul></div>\n");
 }
 
 
-/*
+/**
+ * \brief roomtree view of the iconbar
  * If the user has toggled the icon bar over to a room list, here's where
  * we generate its innerHTML...
  */
@@ -332,7 +342,10 @@ void do_iconbar_roomlist(void) {
        char key[SIZ], value[SIZ];
        int i;
 
-       /* The initialized values of these variables also happen to
+       WC->current_iconbar = current_iconbar_roomlist;
+
+       /**
+        * The initialized values of these variables also happen to
         * specify the default values for users who haven't customized
         * their iconbars.  These should probably be set in a master
         * configuration somewhere.
@@ -379,27 +392,38 @@ void do_iconbar_roomlist(void) {
                _("CITADEL")
        );
 
-       wprintf("<li><div align=\"center\">"
-               "<a href=\"javascript:switch_to_menu_buttons()\">switch to menu</a>"
-               "</div>"
+       wprintf("<li><div align=\"center\"><a href=\"javascript:switch_to_menu_buttons()\">");
+       wprintf(_("switch to menu"));
+       wprintf("</a></div>");
+
+       wprintf("<li>"
+               "<a href=\"termquit\" TITLE=\"%s\" "
+               "onClick=\"return confirm('%s');\">",
+               _("Log off"),
+               _("Log off now?")
+               
        );
-       
-       wprintf("</ul>\n");
+       if (ib_displayas != IB_TEXTONLY) {
+       wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
+               "src=\"static/logoff_32x.gif\">");
+       }
+       if (ib_displayas != IB_PICONLY) {
+               wprintf(_("Log off"));
+       }
+       wprintf("</A></li>\n");
 
-       /* embed the room list */
-       list_all_rooms_by_floor("iconbar");
+       wprintf("</ul></div>\n");
 
-       /*
-       wprintf("<div id=\"dropstuff\" style=\"font-size:6pt\">");
-       wprintf("Drag to trash here...<br>");
-       wprintf("</div>");
-       */
+       /** embed the room list */
+       list_all_rooms_by_floor("iconbar");
 
        wprintf("</div>\n");
 }
 
 
-
+/**
+ * \brief display a customized version of the iconbar
+ */
 void display_customize_iconbar(void) {
        char iconbar[SIZ];
        char buf[SIZ];
@@ -407,24 +431,25 @@ void display_customize_iconbar(void) {
        int i;
        int bar = 0;
 
-       /* The initialized values of these variables also happen to
+       /**
+        * The initialized values of these variables also happen to
         * specify the default values for users who haven't customized
         * their iconbars.  These should probably be set in a master
         * configuration somewhere.
         */
-       int ib_displayas = IB_PICTEXT;  /* pictures and text, pictures, text */
-       int ib_logo = 0;        /* Site logo */
-       int ib_summary = 1;     /* Summary page icon */
-       int ib_inbox = 1;       /* Inbox icon */
-       int ib_calendar = 1;    /* Calendar icon */
-       int ib_contacts = 1;    /* Contacts icon */
-       int ib_notes = 1;       /* Notes icon */
-       int ib_tasks = 1;       /* Tasks icon */
-       int ib_rooms = 1;       /* Rooms icon */
-       int ib_users = 1;       /* Users icon */
-       int ib_chat = 1;        /* Chat icon */
-       int ib_advanced = 1;    /* Advanced Options icon */
-       int ib_citadel = 1;     /* 'Powered by Citadel' logo */
+       int ib_displayas = IB_PICTEXT;  /**< pictures and text, pictures, text */
+       int ib_logo = 0;        /**< Site logo */
+       int ib_summary = 1;     /**< Summary page icon */
+       int ib_inbox = 1;       /**< Inbox icon */
+       int ib_calendar = 1;    /**< Calendar icon */
+       int ib_contacts = 1;    /**< Contacts icon */
+       int ib_notes = 1;       /**< Notes icon */
+       int ib_tasks = 1;       /**< Tasks icon */
+       int ib_rooms = 1;       /**< Rooms icon */
+       int ib_users = 1;       /**< Users icon */
+       int ib_chat = 1;        /**< Chat icon */
+       int ib_advanced = 1;    /**< Advanced Options icon */
+       int ib_citadel = 1;     /**< 'Powered by Citadel' logo */
        /*
         */
 
@@ -459,7 +484,7 @@ void display_customize_iconbar(void) {
                "</div>\n<div id=\"content\">\n"
        );
 
-       wprintf("<div id=\"fix_scrollbar_bug\">"
+       wprintf("<div class=\"fix_scrollbar_bug\">"
                "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>");
 
        wprintf("<FORM METHOD=\"POST\" action=\"commit_iconbar\">\n");
@@ -607,7 +632,7 @@ void display_customize_iconbar(void) {
                ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
                (ib_rooms ? "CHECKED" : ""),
                _("Rooms"),
-               _("Clicking this icon displays a list of all accesible "
+               _("Clicking this icon displays a list of all accessible "
                "rooms (or folders) available.")
        );
 
@@ -691,7 +716,9 @@ void display_customize_iconbar(void) {
        wDumpContent(2);
 }
 
-
+/**
+ * \brief commit the changes of an edited iconbar ????
+ */
 void commit_iconbar(void) {
        char iconbar[SIZ];
        int i;
@@ -742,3 +769,6 @@ void commit_iconbar(void) {
        wDumpContent(2);
 }
 
+
+
+/*@}*/