FR.editSettings={};var themesList=[];Ext.each(FR.themes,function(theme){var borderColor=theme.css["--theme-main"];var bgColor=theme.css["--theme-lighter"];var textColor=theme.css["--theme-textOnLighter"];var bRadius=theme.css["--sBr"];var label='<span style="display:inline-block;padding:1px 6px;border:1px solid '+borderColor+";background-color:"+bgColor+";color:"+textColor+";border-radius:"+bRadius+';min-width:80px">';label+=FR.T(theme.name);label+="</span>";if(theme.default){label+=" ("+FR.T("Default")+")"}var box={boxLabel:label,name:"settings[ui_theme]",inputValue:theme.id,checked:FR.settings.ui_theme==theme.id};if(FR.system.isFree&&!theme.free){box.disabled=true}themesList.push(box)});FR.editSettings.formPanel=new FR.components.editForm({title:"Branding options",layout:"form",labelWidth:150,autoScroll:true,defaults:{width:600},items:[{xtype:"fieldset",title:"Login page",defaults:{xtype:"textfield",width:350},items:[{fieldLabel:"Title",name:"settings[ui_login_title]",value:FR.settings.ui_login_title},{fieldLabel:"Logo URL",name:"settings[ui_login_logo]",value:!FR.system.isRegistered?FR.T("Registered installs only"):FR.settings.ui_login_logo,disabled:!FR.system.isRegistered},{fieldLabel:"Page background",name:"settings[ui_login_bg]",value:FR.settings.ui_login_bg,helpText:FR.T("For a background image type in a full URL.")+"<br>"+FR.T("For a background color type in a hexadecimal value, for example %1").replace("%1","<strong>#590099</strong>")},{xtype:"textarea",grow:true,fieldLabel:"Welcome message",name:"settings[ui_login_text]",disabled:FR.system.isFree,value:FR.system.isFree?FR.T("Enterprise version only"):FR.settings.ui_login_text}]},{xtype:"fieldset",defaults:{width:350},items:[{xtype:"textfield",ref:"app_title",fieldLabel:"Application title",name:"settings[app_title]",value:FR.settings.app_title,emptyText:"FileRun"},{xtype:"checkbox",ref:"ui_title_logo",boxLabel:FR.T("Use title as logo")+(!FR.system.isRegistered?" ("+FR.T("Registered installs only")+")":""),width:400,value:1,disabled:!FR.system.isRegistered,name:"settings[ui_title_logo]",checked:parseInt(FR.settings.ui_title_logo),listeners:{check:function(field,checked){if(checked){field.ownerCt.ui_logo_url.disable()}else{field.ownerCt.ui_logo_url.enable()}}}},{xtype:"textfield",ref:"ui_logo_url",fieldLabel:"Logo URL",name:"settings[ui_logo_url]",value:!FR.system.isRegistered?FR.T("Registered installs only"):FR.settings.ui_logo_url,disabled:!FR.system.isRegistered||parseInt(FR.settings.ui_title_logo),helpText:"Recommended height for the image file is 38 pixels"},{xtype:"checkbox",fieldLabel:"Browser favicons",boxLabel:FR.T("Enable")+(!FR.system.isRegistered?" ("+FR.T("Registered installs only")+")":""),width:400,value:1,name:"settings[ui_enable_favicons]",disabled:!FR.system.isRegistered,checked:!FR.system.isRegistered?true:parseInt(FR.settings.ui_enable_favicons),helpText:FR.system.isFree?"":FR.T('You are welcome to customize the icon files inside the folder "%1"').replace("%1","images/favicons/")},{xtype:"textfield",fieldLabel:"Help URL",name:"settings[ui_help_url]",value:FR.system.isFree?FR.T("Enterprise version only"):FR.settings.ui_help_url,disabled:FR.system.isFree,helpText:"URL of your help and support page"},{xtype:"textarea",grow:true,fieldLabel:"Welcome message",name:"settings[ui_welcome_message]",disabled:FR.system.isFree,value:FR.system.isFree?FR.T("Enterprise version only"):FR.settings.ui_welcome_message}]},{xtype:"fieldset",defaults:{width:350},items:[{xtype:"radiogroup",vertical:true,columns:2,fieldLabel:"Color theme",items:themesList},{xtype:"combo",fieldLabel:"Dark mode",name:"settings[ui_theme_dark_mode]",hiddenName:"settings[ui_theme_dark_mode]",autoCreate:true,mode:"local",editable:false,emptyText:"Select...",width:200,displayField:"name",valueField:"id",triggerAction:"all",disableKeyFilter:true,value:FR.settings.ui_theme_dark_mode,store:new Ext.data.SimpleStore({fields:["id","name"],data:[["never",FR.T("Never")],["auto",FR.T("Let browsers decide")],["always",FR.T("Always")]]})},{xtype:"checkbox",boxLabel:'Apply "customizables/theme.css"'+(FR.system.isFree?" ("+FR.T("Enterprise version only")+")":""),width:400,value:1,hidden:FR.system.isFree,name:"settings[ui_theme_load_custom]",checked:parseInt(FR.settings.ui_theme_load_custom)}]}],tbar:[{text:"Save changes",cls:"fr-btn-primary",ref:"saveBtn",handler:function(){var editForm=this.ownerCt.ownerCt;var opts={url:FR.URLRoot+"/?module=cpanel&section=settings&action=save",maskText:"Saving changes...",params:editForm.form.getFieldValues()};editForm.submitForm(opts)}}]});Ext.getCmp("appTab").add(FR.editSettings.formPanel);Ext.getCmp("appTab").doLayout();