class FwdPlugin extends ActionPlugin {
function FwdPlugin() { $this->ActionPlugin(); }
function rtti() { return 1; }
- function name() { return "Forward To"; }
+ function name() { return _i18n('1_fwd_to'); }
function to_js() {
- $res = "function(Node, data) {\n"
- . " var i,j;\n"
- . " var sel = 0;\n"
- . " var select = document.createElement('select');\n"
- . " select.setAttribute('name', Node.name+'[1]');\n"
- . "\n"
- . " Node.appendChild(document.createTextNode(' email : '));\n"
- . " Node.appendChild(select);\n"
- . "\n"
- . " for(i=0,j=0; i<mail_pool.length; i++) {\n"
- . " if(data[1]==i) sel = j;\n"
- . " if(mail_pool[i])\n"
- . " select.options[j++] = new Option(mail_pool[i],i,false,(data[1]==i));\n"
- . " }\n"
- . " select.selectedIndex = sel;\n"
- . "}";
+ return <<<EOF
+function(Node, data) {
+ var i,j;
+ var sel = 0;
+ var select = document.createElement('select');
+ select.setAttribute('name', Node.name+'[1]');
+ Node.appendChild(document.createTextNode(' '));
- return $res;
+ // OG: must insert select node before creating options because of IE5 bug
+ Node.appendChild(select);
+
+ for(i=0,j=0; i<mail_pool.length; i++) {
+ if(data[1]==i) sel = j;
+ if(mail_pool[i])
+ select.options[j++] = new Option(mail_pool[i],i,false,(data[1]==i));
+ }
+ select.selectedIndex = sel;
+}
+EOF;
+ }
+
+ function to_string($_data) {
+ global $mail_pool;
+ return " cc \"! ".$mail_pool->emails[$_data[1]]->email."\"\n";
}
}