<% -- Plugin Name: Send Files -- Description: Generate multiple weblinks and send them -- Author: wftpserver (https://www.wftpserver.com) -- Version: 1.2 local tab = {} tab.plugin_enabled = true tab.extbutton_name = LANG["str_app_sendfile"] or "Send Files" tab.extbutton_func = "make_multiple_weblinks()" tab.extbutton_icon = "plugins/sendfiles/icon.gif" tab.need_selectfile = false local str_sendfile_tips = LANG["str_sendfile_tips"] or "Generate the web links for the following files and send them:" local smtperror = "" if c_CanSendMessage() == false then smtperror = "alert('"..LANG["str_no_smtpconfig"].."'); return false;" end tab.extjs = [[ function make_multiple_weblinks() { ]]..smtperror..[[ var filelist = getCheckedDirlist(0); var dirlist = getCheckedDirlist(1); if(filelist == "" && dirlist == "") { alert("]]..LANG['no_checkbox']..[["); return false; } else { var temp_filelist = filelist.replace(/\|\|/ig, "\n"); var temp_dirlist = dirlist.replace(/\|\|/ig, "\n"); showMessagebox("Send Files","

]]..str_sendfile_tips..[[
]]..LANG['str_expire_on']..[[: | ]]..LANG['str_optional']..[[
]]..LANG['str_download_limit']..[[: | ]]..LANG['str_optional']..[[
]]..LANG['password']..[[ | ]]..LANG['str_optional']..[[
]]..LANG['str_sendmail']..[[: |
]]..LANG['str_senderemail']..[[: | ]]..LANG['str_optional']..[[
]]..LANG['str_field_message']..' '..LANG['str_optional']..[[: |

",null,530,400); $("input_files").value = temp_filelist + "\n" + temp_dirlist; if(isIE) { $("btn_submit").onclick = function(){send_weblinks();}; $("btn_cancel").onclick = function(){top.closewindow();}; } } } function send_weblinks() { var xmlhttpObj = isIE ? new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest(); var expiretime = htmldecode($("expiretime").value); var downloadlimit = htmldecode($("downloadlimit").value); var downloadpass = htmldecode($("downloadpass").value); var mailaddress = htmldecode($("mail_address").value); var sender_mailaddress = htmldecode($("sender_mail_address").value); var mail_message = htmldecode($("mail_message").value); var weblink_url = "]]..c_GetWeblinkURL()..[["; var localaddress = weblink_url; if(localaddress == "") localaddress = location.href.replace(/\#/g,""); if(mailaddress == "" || mailaddress == "]]..LANG['str_multiple_emails']..[[") { alert("Please specify one or more recipients!"); return false; } $("waitingdiv").style.display = ""; xmlhttpObj.open("POST","plugins/sendfiles/generate_weblinks.html"); xmlhttpObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttpObj.onreadystatechange = function(){ if (xmlhttpObj.readyState == 4) { ajaxlock = false; if (xmlhttpObj.status == 200) { try { if(xmlhttpObj.responseText != "") { alert(xmlhttpObj.responseText); } unselectAll(); top.closewindow(); } catch(e) { } finally { $("waitingdiv").style.display = "none"; } } else { $("waitingdiv").style.display = "none"; } } }; xmlhttpObj.send("filelist="+urlEncode(getCheckedDirlist(0))+"&dirlist="+urlEncode(getCheckedDirlist(1))+"&mailaddress="+urlEncode(mailaddress)+"&sender_mailaddress="+urlEncode(sender_mailaddress)+"&mail_message="+urlEncode(mail_message)+"&localaddress="+urlEncode(localaddress)+"&expiretime="+urlEncode(expiretime)+"&downloadlimit="+urlEncode(downloadlimit)+"&downloadpass="+urlEncode(downloadpass)+"&r="+Math.random()); } ]] register_plugin(tab) %>