FR.editSettings={};FR.editSettings.formPanel=new FR.components.editForm({title:"E-mail settings",layout:"form",labelWidth:150,autoScroll:true,items:[{xtype:"fieldset",checkboxToggle:{tag:"input",type:"checkbox",name:this.checkboxName||this.id+"-checkbox",id:"settings[smtp_enable]"},checkboxName:"settings[smtp_enable]",title:"Use a SMTP server.",animCollapse:true,collapsed:!parseInt(FR.settings.smtp_enable),width:600,defaults:{width:250},listeners:{expand:function(){this.doLayout()}},items:[{xtype:"textfield",fieldLabel:"SMTP server",name:"settings[smtp_host]",value:FR.settings.smtp_host},{xtype:"textfield",fieldLabel:"Port number",width:50,name:"settings[smtp_port]",value:FR.settings.smtp_port},{xtype:"combo",fieldLabel:"Security",name:"settings[smtp_security]",hiddenName:"settings[smtp_security]",autoCreate:true,mode:"local",editable:false,displayField:"name",valueField:"id",triggerAction:"all",disableKeyFilter:true,value:FR.settings.smtp_security,store:new Ext.data.SimpleStore({fields:["id","name"],data:[["none",FR.T("None")],["tls",FR.T("TLS")],["ssl",FR.T("SSL")]]})},{xtype:"checkbox",boxLabel:"SMTP requires authentication.",value:1,name:"settings[smtp_auth]",checked:parseInt(FR.settings.smtp_auth)},{xtype:"textfield",fieldLabel:"SMTP username",name:"settings[smtp_username]",value:FR.settings.smtp_username},{xtype:"textfield",fieldLabel:"SMTP password",name:"settings[smtp_password]",value:FR.settings.smtp_password,inputType:"password",listeners:{focus:function(){this.getEl().dom.setAttribute("type","text")},blur:function(){this.getEl().dom.setAttribute("type","password")}}},{xtype:"panel",autoWidth:true,layout:"hbox",items:[{margins:"0 0 10px 175px",xtype:"button",text:"Test settings",cls:"fr-btn-primary fr-btn-smaller fr-btn-nomargin",handler:function(){var params=this.ownerCt.ownerCt.ownerCt.form.getValues();var output=this.ownerCt.ownerCt.serverReply;output.show();FR.utils.getAjaxOutput(FR.URLRoot+"/?module=cpanel&section=settings&page=email&action=test",params,output)}}]},{xtype:"displayfield",ref:"serverReply",width:300,value:"test",style:"border:1px solid silver;padding:3px;white-space:nowrap;overflow:auto;max-height:160px;font-size:10px;",hidden:true}]},{xtype:"fieldset",title:"E-mail notifications",width:600,defaults:{width:350},items:[{xtype:"textfield",width:250,fieldLabel:"From e-mail address",name:"settings[default_notification_address]",value:FR.settings.default_notification_address},{xtype:"textfield",width:250,fieldLabel:"From name",name:"settings[default_notification_name]",value:FR.settings.default_notification_name},{xtype:"textfield",fieldLabel:"Subject template",name:"settings[notifications_subject_template]",value:FR.settings.notifications_subject_template},{xtype:"textarea",height:220,fieldLabel:"Message template",name:"settings[notifications_template]",value:FR.settings.notifications_template},{xtype:"textfield",width:250,fieldLabel:"BCC",name:"settings[notifications_bcc]",value:FR.settings.notifications_bcc,helpText:FR.T("Specify an e-mail address where to send copies of the notifications")},{xtype:"checkbox",boxLabel:"Instant email notifications",value:1,name:"settings[instant_email_notifications]",checked:parseInt(FR.settings.instant_email_notifications),helpText:FR.T("Uncheck this option if you will be running the notification script using a scheduled task.")},{xtype:"checkbox",disabled:FR.system.isFree,boxLabel:"Allow users to set notification settings to folders.",value:1,helpText:FR.system.isFree?"Enterprise version only":false,name:"settings[allow_folder_notifications]",checked:parseInt(FR.settings.allow_folder_notifications)}]},{xtype:"fieldset",hidden:FR.system.isFree,title:"Misc",labelWidth:1,width:600,defaults:{width:500},items:[{xtype:"checkbox",boxLabel:"Allow the users to edit the e-mail address they are sending files from.",value:1,name:"settings[send_from_custom_email]",checked:parseInt(FR.settings.send_from_custom_email)}]}],tbar:[{text:"Save changes",cls:"fr-btn-primary",ref:"saveBtn",handler:function(){var editForm=this.ownerCt.ownerCt;var params=editForm.form.getFieldValues();var extra={};extra["settings[smtp_enable]"]=Ext.get("settings[smtp_enable]").dom.checked?1:0;Ext.apply(params,extra);var opts={url:FR.URLRoot+"/?module=cpanel&section=settings&action=save",maskText:"Saving changes...",params:params};editForm.submitForm(opts)}}]});Ext.getCmp("appTab").add(FR.editSettings.formPanel);Ext.getCmp("appTab").doLayout();