X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fsieve.c;h=0db8f5ae0bca9b1cdc1ec4e0c26bb51ab867d5a5;hb=fd034bea666febed8eff22cf10f2b72b8b009665;hp=dc511b4ab83c6bd6d7696a9808486784cdf518d5;hpb=5dc7d255bba61dbc1138eb8bf9c3b063acc01124;p=citadel.git diff --git a/webcit/sieve.c b/webcit/sieve.c index dc511b4ab..0db8f5ae0 100644 --- a/webcit/sieve.c +++ b/webcit/sieve.c @@ -1,5 +1,19 @@ -/* - * $Id$ +/* + * Copyright (c) 1996-2011 by the citadel.org team + * + * This program is open source software. You can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "webcit.h" @@ -16,23 +30,22 @@ void display_no_sieve(void) { output_headers(1, 1, 2, 0, 0, 0); - wprintf("
\n"); - wprintf(""); - wprintf("

"); - wprintf(_("View/edit server-side mail filters")); - wprintf("

\n"); - wprintf("
\n"); + wc_printf("
\n"); + wc_printf(""); + wc_printf("

"); + wc_printf(_("View/edit server-side mail filters")); + wc_printf("

\n"); + wc_printf("
\n"); - wprintf("
\n"); + wc_printf("
\n"); - wprintf("
" - "" + wc_printf("
" "
\n"); - wprintf(_("This installation of Citadel was built without support for server-side mail filtering." + wc_printf(_("This installation of Citadel was built without support for server-side mail filtering." "
Please contact your system administrator if you require this feature.
")); - wprintf("
\n"); + wc_printf("\n"); wDumpContent(1); } @@ -45,7 +58,7 @@ void display_sieve(void) char script_names[MAX_SCRIPTS][64]; int num_scripts = 0; int active_script = (-1); - char buf[256]; + char buf[SIZ]; /* Don't make this buffer smaller or it will restrict line length */ int i; int rules_script_is_active = 0; @@ -73,7 +86,7 @@ void display_sieve(void) output_headers(1, 1, 2, 0, 0, 0); - wprintf(" \n" ); - wprintf("
\n"); - wprintf(""); - wprintf("

"); - wprintf(_("View/edit server-side mail filters")); - wprintf("

\n"); - wprintf("
\n"); + wc_printf("
\n"); + wc_printf(""); + wc_printf("

"); + wc_printf(_("View/edit server-side mail filters")); + wc_printf("

\n"); + wc_printf("
\n"); - wprintf("
\n"); + wc_printf("
\n"); - wprintf("
" - "" + wc_printf("
" "
\n"); - wprintf("
\n"); - wprintf("\n", WC->nonce); + wc_printf("\n"); + wc_printf("\n", WC->nonce); - wprintf(_("When new mail arrives: ")); - wprintf("\n"); - wprintf("\n"); + wc_printf("\n"); - wprintf("\n"); + wc_printf("\n"); - wprintf("\n"); + wc_printf(_("Filter it through a manually edited script (advanced users only)")); + wc_printf("\n"); - wprintf(""); + wc_printf(""); /* The "no filtering" div */ - wprintf("
\n"); - wprintf("


"); - wprintf(_("Your incoming mail will not be filtered through any scripts.")); - wprintf("

\n"); - wprintf("
\n"); + wc_printf("
\n"); + wc_printf("


"); + wc_printf(_("Your incoming mail will not be filtered through any scripts.")); + wc_printf("

\n"); + wc_printf("
\n"); /* The "webcit managed scripts" div */ - wprintf("
\n"); + wc_printf("
\n"); display_rules_editor_inner_div(); - wprintf("
\n"); + wc_printf("
\n"); /* The "I'm smart and can write my own Sieve scripts" div */ - wprintf("
\n"); + wc_printf("
\n"); if (num_scripts > 0) { - wprintf(_("The currently active script is: ")); - wprintf("\n"); for (i=0; i%s\n", + wc_printf("\n", ((active_script == i) ? "selected" : ""), script_names[i], script_names[i] ); } } - wprintf("\n"); + wc_printf("\n"); } - wprintf("   "); - wprintf("%s\n", _("Add or delete scripts")); + wc_printf("   "); + wc_printf("%s\n", _("Add or delete scripts")); - wprintf("
\n"); + wc_printf("
\n"); if (num_scripts > 0) { for (i=0; i\n", script_names[i]); - wprintf("\n"); - wprintf("
\n"); + wc_printf("\n"); + wc_printf("
\n"); } } } - wprintf(" \n" ); - wprintf("\n"); + wc_printf("\n"); /* The rest of this is common for all panels... */ - wprintf("

"); - wprintf("", _("Save changes")); - wprintf(" "); - wprintf("\n", _("Cancel")); - wprintf("
\n"); + wc_printf("

"); + wc_printf("", _("Save changes")); + wc_printf(" "); + wc_printf("\n", _("Cancel")); + wc_printf("
\n"); - wprintf("
\n"); + wc_printf("\n"); - wprintf(" \n" ); @@ -643,56 +655,59 @@ void display_add_remove_scripts(char *message) char script_name[256]; output_headers(1, 1, 2, 0, 0, 0); - wprintf("
\n"); - wprintf(""); - wprintf(_("Add or delete scripts")); - wprintf("\n"); - wprintf("
\n"); + wc_printf("
\n"); + wc_printf(""); + wc_printf(_("Add or delete scripts")); + wc_printf("\n"); + wc_printf("
\n"); - wprintf("
\n"); + wc_printf("
\n"); if (message != NULL) { - wprintf("%s", message); + wc_printf("%s", message); } - wprintf("
\n"); + wc_printf("
\n"); - svput("BOXTITLE", WCS_STRING, _("Add a new script")); - do_template("beginboxx", NULL); + do_template("beginbox_1"); + StrBufAppendBufPlain(WC->WBuf, _("Add a new script"), -1, 0); + do_template("beginbox_2"); - wprintf(_("To create a new script, enter the desired " + wc_printf(_("To create a new script, enter the desired " "script name in the box below and click 'Create'.")); - wprintf("

"); + wc_printf("

"); - wprintf("
\n"); - wprintf("\n", WC->nonce); - wprintf(_("Script name: ")); - wprintf("
\n" + wc_printf("
\n"); + wc_printf("\n", WC->nonce); + wc_printf(_("Script name: ")); + wc_printf("
\n" "" "
\n", _("Create")); - do_template("endbox", NULL); + do_template("endbox"); - svput("BOXTITLE", WCS_STRING, _("Edit scripts")); - do_template("beginboxx", NULL); - wprintf("
%s

\n", + do_template("beginbox_1"); + StrBufAppendBufPlain(WC->WBuf, _("Edit scripts"), -1, 0); + do_template("beginbox_2"); + wc_printf("
%s

\n", _("Return to the script editing screen") ); - do_template("endbox", NULL); + do_template("endbox"); - wprintf("
"); + wc_printf(""); - svput("BOXTITLE", WCS_STRING, _("Delete scripts")); - do_template("beginboxx", NULL); + do_template("beginbox_1"); + StrBufAppendBufPlain(WC->WBuf, _("Delete scripts"), -1, 0); + do_template("beginbox_2"); - wprintf(_("To delete an existing script, select the script " + wc_printf(_("To delete an existing script, select the script " "name from the list and click 'Delete'.")); - wprintf("

"); + wc_printf("

"); - wprintf("
" + wc_printf("
" "
\n"); - wprintf("\n", WC->nonce); - wprintf("\n", WC->nonce); + wc_printf("
\n"); + wc_printf("
\n"); - wprintf("", _("Delete script"), _("Delete this script?")); - wprintf("
\n"); - do_template("endbox", NULL); + wc_printf("
\n"); + do_template("endbox"); - wprintf("
\n"); + wc_printf("
\n"); wDumpContent(1); } @@ -820,7 +835,7 @@ void display_rules_editor_inner_div(void) { * This script should get called by every onChange event... * */ - wprintf(" \n"); + wc_printf(" \n"); free(rooms); } @@ -1172,9 +1187,9 @@ void InitModule_SIEVE (void) { - WebcitAddUrlHandler(HKEY("display_sieve"), display_sieve, 0); - WebcitAddUrlHandler(HKEY("save_sieve"), save_sieve, 0); - WebcitAddUrlHandler(HKEY("display_add_remove_scripts"), _display_add_remove_scripts, 0); - WebcitAddUrlHandler(HKEY("create_script"), create_script, 0); - WebcitAddUrlHandler(HKEY("delete_script"), delete_script, 0); + WebcitAddUrlHandler(HKEY("display_sieve"), "", 0, display_sieve, 0); + WebcitAddUrlHandler(HKEY("save_sieve"), "", 0, save_sieve, 0); + WebcitAddUrlHandler(HKEY("display_add_remove_scripts"), "", 0, _display_add_remove_scripts, 0); + WebcitAddUrlHandler(HKEY("create_script"), "", 0, create_script, 0); + WebcitAddUrlHandler(HKEY("delete_script"), "", 0, delete_script, 0); }