From: Pierre Habouzit Date: Mon, 22 Sep 2003 15:49:25 +0000 (+0000) Subject: adding a function : to_header_string -> filter to execute at the beginning X-Git-Tag: procmail~13 X-Git-Url: http://git.polytechnique.org/?p=old-projects.git;a=commitdiff_plain;h=99dcf940fad4ce8a16963aa9466c668db2876c99 adding a function : to_header_string -> filter to execute at the beginning of the procmailrc to avoid for example mail loops. do not implement if the action/match doesn't need it. first implementation of autoreply --- diff --git a/philter/philter/include/plugin.inc.php b/philter/philter/include/plugin.inc.php index 71894c3..851cce4 100644 --- a/philter/philter/include/plugin.inc.php +++ b/philter/philter/include/plugin.inc.php @@ -54,6 +54,8 @@ class Plugin { */ function to_string($_data) { return ""; } + function to_header_string() { return ""; } + /** returns the function that creates the form in javascript (@see FwdPlugin for one example). * @return the string containing the javascript code */ diff --git a/philter/philter/include/plugin_autoreply.inc.php b/philter/philter/include/plugin_autoreply.inc.php index 4b12b29..cc517e0 100644 --- a/philter/philter/include/plugin_autoreply.inc.php +++ b/philter/philter/include/plugin_autoreply.inc.php @@ -13,20 +13,36 @@ class AutoReplyPlugin extends ActionPlugin { function name() { return _i18n('2_auto_reply'); } function to_js() { - $res = "function(Node, data) {\n" - . " var i,j;\n" - . " var ta = document.createElement('textarea');\n" - . " ta.setAttribute('name', Node.name+'[1]');\n" - . " ta.setAttribute('style', 'width:100%;');\n" - . " ta.setAttribute('rows', '10');\n" - . " if(data[1]) ta.value = data[1];\n" - . "\n" - . " Node.appendChild(document.createElement('br'));\n" - . " Node.appendChild(ta);\n" - . "}"; - + return <<