]> code.citadel.org Git - citadel.git/commitdiff
* More work on customizable iconbar
authorArt Cancro <ajc@citadel.org>
Sun, 3 Aug 2003 21:02:04 +0000 (21:02 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 3 Aug 2003 21:02:04 +0000 (21:02 +0000)
webcit/ChangeLog
webcit/iconbar.c
webcit/static/iconbar.html
webcit/webcit.c
webcit/webcit.h

index af3974b740d4db11f1acef75bfc9b6be4073022f..eea68a27342a294a5c4fd0c33216380aa5ba43c6 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 500.12  2003/08/03 21:02:01  ajc
+* More work on customizable iconbar
+
 Revision 500.11  2003/08/02 05:25:46  ajc
 * Laid the groundwork for a customizable iconbar
 
@@ -1533,4 +1536,3 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
-
index 3f4558ba8ffc2a66e1cea4f09c0054988f900293..12727346b061142e3d828a43fd5246f57d825423 100644 (file)
@@ -29,8 +29,25 @@ void do_iconbar(void) {
 
 
 
-void customize_iconbar(void) {
+void display_customize_iconbar(void) {
        char iconbar[SIZ];
+       char buf[SIZ];
+       char key[SIZ], value[SIZ];
+       int i;
+
+       /* 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_logo = 1;        /* Site logo */
+       int ib_rooms = 1;       /* Rooms icon */
+       int ib_users = 1;       /* Users icon */
+       int ib_advanced = 1;    /* Advanced Options icon */
+       int ib_logoff = 1;      /* Logoff button */
+       int ib_citadel = 1;     /* 'Powered by Citadel' logo */
+       /*
+        */
 
        output_headers(3);
        svprintf("BOXTITLE", WCS_STRING, "Customize the icon bar");
@@ -41,6 +58,21 @@ void customize_iconbar(void) {
                "screen.</CENTER><HR>\n"
        );
 
+       get_preference("iconbar", iconbar);
+       for (i=0; i<num_tokens(iconbar, '|'); ++i) {
+               extract_token(buf, iconbar, i, '|');
+               extract_token(key, buf, 0, '=');
+               extract_token(value, buf, 1, '=');
+
+               if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
+               if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
+               if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
+               if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
+               if (!strcasecmp(key, "ib_logoff")) ib_logoff = atoi(value);
+               if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
+
+       }
+
        wprintf("(FIXME this is not done yet)");
 
        do_template("endbox");
index 58e6e19c929498d4de33cbd7773484d38fd40cc6..9ae97829fbd8340cd8f974340da983439179a29c 100644 (file)
@@ -50,8 +50,8 @@ Log off</A>
 
 
 <SPAN CLASS="customize">
-<A HREF="/customize_iconbar" TITLE="Customize this menu" TARGET="workspace">
-customize this menu</A>
+<A HREF="/display_customize_iconbar" TITLE="Customize this menu"
+TARGET="workspace">customize this menu</A>
 </SPAN>
 <BR>
 
index 58a7b46f6379918fbe71845eae43b82ddc68e21b..46ba43969fb9837b72f55fb06837d57d25baf06a 100644 (file)
@@ -1158,8 +1158,8 @@ void session_loop(struct httprequest *req)
                summary();
        } else if (!strcasecmp(action, "iconbar")) {
                do_iconbar();
-       } else if (!strcasecmp(action, "customize_iconbar")) {
-               customize_iconbar();
+       } else if (!strcasecmp(action, "display_customize_iconbar")) {
+               display_customize_iconbar();
        } else if (!strcasecmp(action, "diagnostics")) {
                output_headers(1);
 
index 69ffc519104179e7d001c1620b27bf1b05e7c779..aaed9ad30342b8193af60079f46e117bd7e992cc 100644 (file)
@@ -423,4 +423,4 @@ void http_transmit_thing(char *thing, size_t length, char *content_type,
                         int is_static);
 void unescape_input(char *buf);
 void do_iconbar(void);
-void customize_iconbar(void);
+void display_customize_iconbar(void);