]> code.citadel.org Git - citadel.git/blobdiff - webcit/sieve.c
started add/remove scripts
[citadel.git] / webcit / sieve.c
index 3fdb54f253f580d43285766f4e3439abe5bdd6e4..86758d079aeafd8adecc4c2094e8573cbe759ee4 100644 (file)
@@ -134,6 +134,11 @@ void display_sieve(void)
                wprintf("</select>\n");
        }
 
+       wprintf("&nbsp;&nbsp;&nbsp;");
+       wprintf("<a href=\"display_add_remove_scripts\">%s</a>\n", _("Add/remove scripts"));
+
+       wprintf("<br />\n");
+
        if (num_scripts > 0) {
                for (i=0; i<num_scripts; ++i) {
                        wprintf("<div id=\"script_%s\" style=\"display:none\">\n", script_names[i]);
@@ -210,30 +215,61 @@ void save_sieve(void) {
        bigaction = atoi(bstr("bigaction"));
 
        if (bigaction == 0) {
-               lprintf(9, "MSIV setactive||");
+               serv_puts("MSIV setactive||");
+               serv_getln(buf, sizeof buf);
        }
 
        else if (bigaction == 2) {
-               lprintf(9, "MSIV setactive|%s|", bstr("active_script"));
+               serv_printf("MSIV setactive|%s|", bstr("active_script"));
+               serv_getln(buf, sizeof buf);
        }
 
        if (num_scripts > 0) {
                for (i=0; i<num_scripts; ++i) {
-                       lprintf(9, "MSIV putscript|%s|", script_names[i]);
-                       snprintf(this_name, sizeof this_name, "text_%s", script_names[i]);
-                       lprintf(9, "%s\n", bstr(this_name));
-                       lprintf(9, "000\n");
+                       serv_printf("MSIV putscript|%s|", script_names[i]);
+                       serv_getln(buf, sizeof buf);
+                       if (buf[0] == '4') {
+                               snprintf(this_name, sizeof this_name, "text_%s", script_names[i]);
+                               striplt(bstr(this_name));
+                               serv_printf("%s", bstr(this_name));
+                               serv_puts("000");
+                       }
                }
        }
 
+       strcpy(WC->ImportantMessage, _("Your changes have been saved."));
+       display_main_menu();
+       return;
+}
 
 
+void display_add_remove_scripts(void) {
+       output_headers(1, 1, 2, 0, 0, 0);
 
+       wprintf("<div id=\"banner\">\n");
+       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
+       wprintf("<SPAN CLASS=\"titlebar\">");
+       wprintf(_("Add/remove Sieve scripts"));
+       wprintf("</SPAN>\n");
+       wprintf("</TD></TR></TABLE>\n");
+       wprintf("</div>\n<div id=\"content\">\n");
 
-       strcpy(WC->ImportantMessage, "FIXME");
-       display_main_menu();
-       return;
-}
+       wprintf("<div class=\"fix_scrollbar_bug\">"
+               "<table border=0 width=100%% bgcolor=\"#FFFFFF\">"
+               "<tr><td valign=top>\n");
+
+
+       /* blah blah go here FIXME */
+
+       wprintf("</td></tr></table></div>\n");
 
+       wprintf("<script type=\"text/javascript\">      \n"
+               "ToggleSievePanels();                   \n"
+               "</script>                              \n"
+       );
+
+       wDumpContent(1);
+
+}
 
 /*@}*/