New Upload = 9) { swNavigator='ie9+'; } else { swNavigator='ie'; } wd = 420; hg = 170; } else { swNavigator='wknormal'; wd=420; hg=100; } CURRENT_MAIN_DIRECTORY = MAIN_DIRECTORY; CURRENT_CURRENT_DIRECTORY = CURRENT_DIRECTORY; Pm.tmp.processFilesManagerPanel.events = { remove: function() { oUploadFilesPanel.remove(); }.extend(this) }; oUploadFilesPanel = new leimnud.module.panel(); oUploadFilesPanel.options={ limit : true, size : {w:wd,h:hg}, position : {x:Pm.tmp.processFilesManagerPanel.options.position.x,y:Pm.tmp.processFilesManagerPanel.options.position.y-90,center:false}, title : '', control : {close:true,resize:false},fx:{modal:true}, fx : {shadow:true,modal:true} }; oUploadFilesPanel.make(); oIFrame = window.document.createElement('iframe'); oIFrame.style.border = '0'; oIFrame.style.width = '100%'; oIFrame.style.height = '100%'; oIFrame.src = 'processes_UploadFilesForm?PRO_UID=' + PRO_UID + '&MAIN_DIRECTORY=' + MAIN_DIRECTORY + '&CURRENT_DIRECTORY=' + CURRENT_DIRECTORY+'&NAVIGATOR='+swNavigator; oUploadFilesPanel.addContent(oIFrame); }; var oPanel; function editFile(pro_uid, fileName){ var typofile = fileName.split("."); if( typofile[typofile.length-1].toLowerCase() != 'txt' && typofile[typofile.length-1].toLowerCase() != 'html' ){ msgBox(G_STRINGS.HTML_FILES,"alert");return; } oPanel = new leimnud.module.panel(); oPanel.options={ limit : true, size : {w:800,h:600}, position : {x:50,y:50,center:true}, title : '', control : {close:true,resize:false},fx:{modal:true}, fx : {shadow:true,modal:true} }; oPanel.make(); var oRPC = new leimnud.module.rpc.xmlhttp({ url : 'processes_Ajax', args: 'action=editFile&filename='+fileName+'&pro_uid='+pro_uid }); oPanel.loader.show(); oRPC.callback = function(rpc) { oPanel.loader.hide(); oPanel.addContent(rpc.xmlhttp.responseText); var scs=rpc.xmlhttp.responseText.extractScript(); scs.evalScript(); }.extend(this); oRPC.make(); } function saveFile(pro_uid, fileName){ var fc64 = base64_encode(getField('fcontent').value); fc64 = fc64.replace(/&/g, "@amp@"); fc64 = fc64.replace(/\+/g, '%2B'); var oRPC = new leimnud.module.rpc.xmlhttp({ url : 'processes_Ajax', args: 'action=saveFile&filename='+fileName+'&pro_uid='+pro_uid+'&MAIN_DIRECTORY='+CURRENT_MAIN_DIRECTORY+'&fcontent='+fc64 }); oPanel.loader.show(); oRPC.callback = function(rpc) { oPanel.remove(); }.extend(this); oRPC.make(); } var showCreateEmptyOptionsPanel; function showCreateEmptyOptions(e, MAIN_DIRECTORY){ CURRENT_MAIN_DIRECTORY = MAIN_DIRECTORY; oPanel = new leimnud.module.panel(); oPanel.options={ limit : true, size : {w:400,h:100}, position : {x:e.clientX,y:e.clientY,center:false}, title : '', control : {close:true,resize:false},fx:{modal:true}, fx : {shadow:true,modal:true} }; oPanel.make(); var oRPC = new leimnud.module.rpc.xmlhttp({url : 'processes_Ajax', args: 'action=emptyFileOptions&MAIN_DIRECTORY='+CURRENT_MAIN_DIRECTORY }); oPanel.loader.show(); oRPC.callback = function(rpc) { oPanel.loader.hide(); oPanel.addContent(rpc.xmlhttp.responseText); var scs=rpc.xmlhttp.responseText.extractScript(); scs.evalScript(); }.extend(this); oRPC.make(); showCreateEmptyOptionsPanel = oPanel; } function saveEmptyFile(){ var fileName = getField('emptyfilename').value + ".html"; fileName = fileName.trim(); var oRPC = new leimnud.module.rpc.xmlhttp({ url : 'processes_Ajax', args: 'action=saveFile&filename='+fileName+'&pro_uid='+CURRENT_PRO_UID+'&MAIN_DIRECTORY='+CURRENT_MAIN_DIRECTORY+'&fcontent=' }); oRPC.callback = function(rpc){ showCreateEmptyOptionsPanel.remove(); /// goToDirectory(CURRENT_PRO_UID, 'mailTemplates', ''); if(typeof(CURRENT_MAIN_DIRECTORY) != "undefined" ) { goToDirectory(CURRENT_PRO_UID, CURRENT_MAIN_DIRECTORY, ''); } else { goToDirectory(CURRENT_PRO_UID, 'mailTemplates', ''); } editFile(CURRENT_PRO_UID, fileName) }.extend(this); oRPC.make(); } function xReaload(){ goToDirectory(CURRENT_PRO_UID, CURRENT_MAIN_DIRECTORY, CURRENT_CURRENT_DIRECTORY); } ]]>