fc3ac95562d4ca810821987d60f0e13b339639c9
[old-projects.git] / philter / philter / include / plugin_forward.inc.php
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; }
13 function name() { return _i18n('1_fwd_to'); }
14
15 function to_js() {
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(' '));
23
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;
39 return " :0 c\n"
40 . " ! ".$mail_pool->emails[$_data[1]]->email."\n\n";
41 }
42 }
43
44 /********************************************************************************
45 * $Id$
46 * vim: set expandtab shiftwidth=4 tabstop=4 softtabstop=4 textwidth=100:
47 ********************************************************************************/
48 ?>