Commit | Line | Data |
---|---|---|
dd8de1ec PH |
1 | <?php |
2 | /******************************************************************************** | |
3 | * include/plugin_forward.inc.php : The class for forwards | |
4 | * ------------------------------ | |
5 | * | |
6 | * This file is part of the philter distribution | |
7 | * Copyright: See COPYING files that comes with this distribution | |
8 | ********************************************************************************/ | |
9 | ||
10 | class FwdPlugin extends ActionPlugin { | |
11 | function FwdPlugin() { $this->ActionPlugin(); } | |
12 | function rtti() { return 1; } | |
5ae3e923 | 13 | function name() { return _i18n('1_fwd_to'); } |
dd8de1ec PH |
14 | |
15 | function to_js() { | |
16 | $res = "function(Node, data) {\n" | |
17 | . " var i,j;\n" | |
8294c7d2 | 18 | . " var sel = 0;\n" |
dd8de1ec PH |
19 | . " var select = document.createElement('select');\n" |
20 | . " select.setAttribute('name', Node.name+'[1]');\n" | |
352acab7 | 21 | . " Node.appendChild(document.createTextNode(' '));\n" |
dd8de1ec | 22 | . "\n" |
fccf8ac8 | 23 | // OG: must insert select node before creating options because of IE5 bug |
e41f82b0 PH |
24 | . " Node.appendChild(select);\n" |
25 | . "\n" | |
8294c7d2 PH |
26 | . " for(i=0,j=0; i<mail_pool.length; i++) {\n" |
27 | . " if(data[1]==i) sel = j;\n" | |
dd8de1ec PH |
28 | . " if(mail_pool[i])\n" |
29 | . " select.options[j++] = new Option(mail_pool[i],i,false,(data[1]==i));\n" | |
8294c7d2 PH |
30 | . " }\n" |
31 | . " select.selectedIndex = sel;\n" | |
dd8de1ec PH |
32 | . "}"; |
33 | ||
34 | return $res; | |
35 | } | |
dd8de1ec PH |
36 | } |
37 | ||
38 | /******************************************************************************** | |
39 | * $Id$ | |
40 | * vim: set expandtab shiftwidth=4 tabstop=4 softtabstop=4 textwidth=100: | |
41 | ********************************************************************************/ | |
42 | ?> |