bufix from Olivier Guillaumin for IE
[old-projects.git] / philter / philter / include / plugin_forward.inc.php
index 21f0577..0b06ede 100644 (file)
@@ -15,23 +15,23 @@ class FwdPlugin extends ActionPlugin {
     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"
-            .   "    for(i=0,j=0; i<mail_pool.length; i++)\n"
-            .   "        if(mail_pool[i])\n"
-            .   "            select.options[j++] = new Option(mail_pool[i],i,false,(data[1]==i));\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 $res;
     }
-
-    function sql_store($_uid, $_rid, $_data) {
-        mysql_query("INSERT INTO actions SET uid='$_uid',rid='$_rid',pid='1',data='{$_data[1]}'");
-    }
 }
 
 /********************************************************************************