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() { | |
27c46cc1 PH |
16 | return <<<EOF |
17 | function(Node, data) { | |
18 | var i,j; | |
19 | var sel = 0; | |
20 | var select = document.createElement('select'); | |
21 | select.setAttribute('name', Node.name+'[1]'); | |
22 | Node.appendChild(document.createTextNode(' ')); | |
dd8de1ec | 23 | |
27c46cc1 PH |
24 | // OG: must insert select node before creating options because of IE5 bug |
25 | Node.appendChild(select); | |
26 | ||
27 | for(i=0,j=0; i<mail_pool.length; i++) { | |
28 | if(data[1]==i) sel = j; | |
29 | if(mail_pool[i]) | |
30 | select.options[j++] = new Option(mail_pool[i],i,false,(data[1]==i)); | |
31 | } | |
32 | select.selectedIndex = sel; | |
33 | } | |
34 | EOF; | |
35 | } | |
36 | ||
37 | function to_string($_data) { | |
38 | global $mail_pool; | |
61a7b630 | 39 | return " cc \"! ".$mail_pool->emails[$_data[1]]->email."\"\n"; |
dd8de1ec | 40 | } |
dd8de1ec PH |
41 | } |
42 | ||
43 | /******************************************************************************** | |
44 | * $Id$ | |
45 | * vim: set expandtab shiftwidth=4 tabstop=4 softtabstop=4 textwidth=100: | |
46 | ********************************************************************************/ | |
47 | ?> |