diff --git a/customer_email.php b/customer_email.php index 33ba1b04..20c7727f 100644 --- a/customer_email.php +++ b/customer_email.php @@ -24,6 +24,7 @@ use Froxlor\Settings; use Froxlor\Api\Commands\Emails as Emails; use Froxlor\Api\Commands\EmailAccounts as EmailAccounts; use Froxlor\Api\Commands\EmailForwarders as EmailForwarders; +use Froxlor\UI\Panel\UI; // redirect if this customer page is hidden via settings if (Settings::IsInList('panel.customer_hide_options', 'email')) { @@ -261,12 +262,10 @@ if ($page == 'overview') { unset($email_edit_data['emails_edit']['sections']['section_a']['fields']['mail_catchall']); } - $email_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($email_edit_data); - - $title = $email_edit_data['emails_edit']['title']; - $image = $email_edit_data['emails_edit']['image']; - - eval("echo \"" . \Froxlor\UI\Template::getTemplate("email/emails_edit") . "\";"); + UI::TwigBuffer('user/form.html.twig', [ + 'formdata' => $email_edit_data['emails_edit'] + ]); + UI::TwigOutputBuffer(); } } elseif ($action == 'togglecatchall' && $id != 0) { try { diff --git a/lib/formfields/admin/admin/formfield.admin_add.php b/lib/formfields/admin/admin/formfield.admin_add.php index 5c108a14..f1914737 100644 --- a/lib/formfields/admin/admin/formfield.admin_add.php +++ b/lib/formfields/admin/admin/formfield.admin_add.php @@ -32,13 +32,16 @@ return array( 'label' => $lng['login']['password'], 'type' => 'password', 'mandatory' => true, - 'autocomplete' => 'off' - ), - 'admin_password_suggestion' => array( - 'label' => $lng['customer']['generated_pwd'], - 'type' => 'text', - 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), - 'value' => \Froxlor\System\Crypt::generatePassword() + 'autocomplete' => 'off', + 'next_to' => [ + 'admin_password_suggestion' => array( + 'next_to_prefix' => $lng['customer']['generated_pwd'].':', + 'type' => 'text', + 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), + 'value' => \Froxlor\System\Crypt::generatePassword(), + 'readonly' => true + ) + ] ), 'def_language' => array( 'label' => $lng['login']['language'], diff --git a/lib/formfields/admin/admin/formfield.admin_edit.php b/lib/formfields/admin/admin/formfield.admin_edit.php index 852c0067..74759483 100644 --- a/lib/formfields/admin/admin/formfield.admin_edit.php +++ b/lib/formfields/admin/admin/formfield.admin_edit.php @@ -39,13 +39,16 @@ return array( 'label' => $lng['login']['password'] . ' (' . $lng['panel']['emptyfornochanges'] . ')', 'type' => 'password', 'autocomplete' => 'off', - 'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true) - ), - 'admin_password_suggestion' => array( - 'label' => $lng['customer']['generated_pwd'], - 'type' => 'text', - 'value' => \Froxlor\System\Crypt::generatePassword(), - 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == '' && ($result['adminid'] == $userinfo['userid'] ? false : true)) + 'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true), + 'next_to' => [ + 'admin_password_suggestion' => array( + 'next_to_prefix' => $lng['customer']['generated_pwd'].':', + 'type' => 'text', + 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == '' && ($result['adminid'] == $userinfo['userid'] ? false : true)), + 'value' => \Froxlor\System\Crypt::generatePassword(), + 'readonly' => true + ) + ] ), 'def_language' => array( 'label' => $lng['login']['language'], diff --git a/lib/formfields/admin/customer/formfield.customer_add.php b/lib/formfields/admin/customer/formfield.customer_add.php index 7a3e67a1..8d7d641e 100644 --- a/lib/formfields/admin/customer/formfield.customer_add.php +++ b/lib/formfields/admin/customer/formfield.customer_add.php @@ -43,14 +43,16 @@ return array( 'new_customer_password' => array( 'label' => $lng['login']['password'], 'type' => 'password', - 'autocomplete' => 'off' - ), - 'new_customer_password_suggestion' => array( - 'label' => $lng['customer']['generated_pwd'], - 'type' => 'text', - 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), - 'value' => \Froxlor\System\Crypt::generatePassword(), - 'readonly' => true + 'autocomplete' => 'off', + 'next_to' => [ + 'new_customer_password_suggestion' => array( + 'next_to_prefix' => $lng['customer']['generated_pwd'].':', + 'type' => 'text', + 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), + 'value' => \Froxlor\System\Crypt::generatePassword(), + 'readonly' => true + ) + ] ), 'sendpassword' => array( 'label' => $lng['admin']['sendpassword'], @@ -107,12 +109,14 @@ return array( 'type' => 'text' ), 'zipcode' => array( - 'label' => $lng['customer']['zipcode'], - 'type' => 'text' - ), - 'city' => array( - 'label' => $lng['customer']['city'], - 'type' => 'text' + 'label' => $lng['customer']['zipcode'] . ' / ' . $lng['customer']['city'], + 'type' => 'text', + 'next_to' => [ + 'city' => array( + 'next_to_prefix' => ' / ', + 'type' => 'text' + ) + ] ), 'phone' => array( 'label' => $lng['customer']['phone'], @@ -147,7 +151,7 @@ return array( ) ), 'section_cpre' => array( - 'visible' => ! empty($hosting_plans), + 'visible' => !empty($hosting_plans), 'title' => $lng['admin']['plans']['use_plan'], 'image' => 'icons/user_add.png', 'fields' => array( @@ -205,7 +209,7 @@ return array( 'mandatory' => true ), 'email_quota' => array( - 'label' => $lng['customer']['email_quota']. ' (' . $lng['customer']['mib'] . ')', + 'label' => $lng['customer']['email_quota'] . ' (' . $lng['customer']['mib'] . ')', 'type' => 'textul', 'value' => 0, 'maxlength' => 9, @@ -252,9 +256,9 @@ return array( 'values' => $phpconfigs, 'value' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 ? [\Froxlor\Settings::Get('system.mod_fcgid_defaultini')] - : ((int) \Froxlor\Settings::Get('phpfpm.enabled') == 1 ? - [\Froxlor\Settings::Get('phpfpm.defaultini')] - : null)), + : ((int) \Froxlor\Settings::Get('phpfpm.enabled') == 1 ? + [\Froxlor\Settings::Get('phpfpm.defaultini')] + : null)), 'is_array' => 1 ), 'perlenabled' => array( diff --git a/lib/formfields/admin/customer/formfield.customer_edit.php b/lib/formfields/admin/customer/formfield.customer_edit.php index a1993de1..efd1cb4b 100644 --- a/lib/formfields/admin/customer/formfield.customer_edit.php +++ b/lib/formfields/admin/customer/formfield.customer_edit.php @@ -48,13 +48,16 @@ return array( 'new_customer_password' => array( 'label' => $lng['login']['password'] . ' (' . $lng['panel']['emptyfornochanges'] . ')', 'type' => 'password', - 'autocomplete' => 'off' - ), - 'new_customer_password_suggestion' => array( - 'label' => $lng['customer']['generated_pwd'], - 'type' => 'text', - 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), - 'value' => \Froxlor\System\Crypt::generatePassword() + 'autocomplete' => 'off', + 'next_to' => [ + 'new_customer_password_suggestion' => array( + 'next_to_prefix' => $lng['customer']['generated_pwd'] . ':', + 'type' => 'text', + 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), + 'value' => \Froxlor\System\Crypt::generatePassword(), + 'readonly' => true + ) + ] ), 'def_language' => array( 'label' => $lng['login']['language'], @@ -110,14 +113,16 @@ return array( 'value' => $result['street'] ), 'zipcode' => array( - 'label' => $lng['customer']['zipcode'], + 'label' => $lng['customer']['zipcode'] . ' / ' . $lng['customer']['city'], 'type' => 'text', - 'value' => $result['zipcode'] - ), - 'city' => array( - 'label' => $lng['customer']['city'], - 'type' => 'text', - 'value' => $result['city'] + 'value' => $result['zipcode'], + 'next_to' => [ + 'city' => array( + 'next_to_prefix' => ' / ', + 'type' => 'text', + 'value' => $result['city'] + ) + ] ), 'phone' => array( 'label' => $lng['customer']['phone'], @@ -158,7 +163,7 @@ return array( ) ), 'section_cpre' => array( - 'visible' => ! empty($hosting_plans), + 'visible' => !empty($hosting_plans), 'title' => $lng['admin']['plans']['use_plan'], 'image' => 'icons/user_add.png', 'fields' => array( @@ -261,7 +266,7 @@ return array( 'label' => $lng['admin']['phpsettings']['title'], 'type' => 'checkbox', 'values' => $phpconfigs, - 'value' => isset($result['allowed_phpconfigs']) && ! empty($result['allowed_phpconfigs']) ? json_decode($result['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY) : array(), + 'value' => isset($result['allowed_phpconfigs']) && !empty($result['allowed_phpconfigs']) ? json_decode($result['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY) : array(), 'is_array' => 1 ), 'perlenabled' => array( diff --git a/lib/formfields/admin/domains/formfield.domains_add.php b/lib/formfields/admin/domains/formfield.domains_add.php index b0c9ac5b..018f16df 100644 --- a/lib/formfields/admin/domains/formfield.domains_add.php +++ b/lib/formfields/admin/domains/formfield.domains_add.php @@ -17,7 +17,7 @@ return array( 'domain_add' => array( 'title' => $lng['admin']['domain_add'], - 'image' => 'icons/domain_add.png', + 'image' => 'fa-solid fa-globe', 'sections' => array( 'section_a' => array( 'title' => $lng['domains']['domainsettings'], @@ -56,15 +56,8 @@ return array( 'label' => $lng['admin']['domain_editable']['title'], 'desc' => $lng['admin']['domain_editable']['desc'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - '1' - ) + 'value' => '1', + 'checked' => true ), 'add_date' => array( 'label' => $lng['domains']['add_date'], @@ -115,17 +108,11 @@ return array( 'label' => $lng['admin']['speciallogfile']['title'], 'desc' => $lng['admin']['speciallogfile']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'specialsettings' => array( 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), - 'style' => 'align-top', 'label' => $lng['admin']['ownvhostsettings'], 'desc' => $lng['serversettings']['default_vhostconf']['description'], 'type' => 'textarea', @@ -137,41 +124,22 @@ return array( 'label' => $lng['admin']['notryfiles']['title'], 'desc' => $lng['admin']['notryfiles']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'writeaccesslog' => array( 'label' => $lng['admin']['writeaccesslog']['title'], 'desc' => $lng['admin']['writeaccesslog']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - '1' - ) + 'value' => '1', + 'checked' => true ), 'writeerrorlog' => array( 'label' => $lng['admin']['writeerrorlog']['title'], 'desc' => $lng['admin']['writeerrorlog']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - '1' - ) + 'value' => '1', + 'checked' => true ) ) ), @@ -184,15 +152,8 @@ return array( 'visible' => ($ssl_ipsandports != '' ? true : false), 'label' => $lng['admin']['domain_sslenabled'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - '1' - ) + 'value' => '1', + 'checked' => true ), 'no_ssl_available_info' => array( 'visible' => ($ssl_ipsandports == '' ? true : false), @@ -213,51 +174,31 @@ return array( 'label' => $lng['domains']['ssl_redirect']['title'], 'desc' => $lng['domains']['ssl_redirect']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'letsencrypt' => array( 'visible' => (\Froxlor\Settings::Get('system.leenabled') == '1' ? ($ssl_ipsandports != '' ? true : false) : false), 'label' => $lng['admin']['letsencrypt']['title'], 'desc' => $lng['admin']['letsencrypt']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'http2' => array( 'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1', 'label' => $lng['admin']['domain_http2']['title'], 'desc' => $lng['admin']['domain_http2']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'override_tls' => array( 'visible' => (($ssl_ipsandports != '' ? true : false) && $userinfo['change_serversettings'] == '1' ? true : false), 'label' => $lng['admin']['domain_override_tls'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'ssl_protocols' => array( 'visible' => (($ssl_ipsandports != '' ? true : false) && $userinfo['change_serversettings'] == '1' && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' ? true : false), @@ -270,19 +211,19 @@ return array( 'values' => array( array( 'value' => 'TLSv1', - 'label' => 'TLSv1
' + 'label' => 'TLSv1' ), array( 'value' => 'TLSv1.1', - 'label' => 'TLSv1.1
' + 'label' => 'TLSv1.1' ), array( 'value' => 'TLSv1.2', - 'label' => 'TLSv1.2
' + 'label' => 'TLSv1.2' ), array( 'value' => 'TLSv1.3', - 'label' => 'TLSv1.3
' + 'label' => 'TLSv1.3<' ) ), 'is_array' => 1 @@ -303,7 +244,6 @@ return array( ), 'ssl_specialsettings' => array( 'visible' => (($ssl_ipsandports != '' ? true : false) && $userinfo['change_serversettings'] == '1' ? true : false), - 'style' => 'align-top', 'label' => $lng['admin']['ownsslvhostsettings'], 'desc' => $lng['serversettings']['default_vhostconf']['description'], 'type' => 'textarea', @@ -314,21 +254,16 @@ return array( 'visible' => (($ssl_ipsandports != '' ? true : false) && $userinfo['change_serversettings'] == '1' ? true : false), 'label' => $lng['admin']['include_ownvhostsettings'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'hsts_maxage' => array( 'visible' => ($ssl_ipsandports != '' ? true : false), 'label' => $lng['admin']['domain_hsts_maxage']['title'], 'desc' => $lng['admin']['domain_hsts_maxage']['description'], - 'type' => 'int', - 'int_min' => 0, - 'int_max' => 94608000, // 3-years + 'type' => 'number', + 'min' => 0, + 'max' => 94608000, // 3-years 'value' => 0 ), 'hsts_sub' => array( @@ -336,65 +271,38 @@ return array( 'label' => $lng['admin']['domain_hsts_incsub']['title'], 'desc' => $lng['admin']['domain_hsts_incsub']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'hsts_preload' => array( 'visible' => ($ssl_ipsandports != '' ? true : false), 'label' => $lng['admin']['domain_hsts_preload']['title'], 'desc' => $lng['admin']['domain_hsts_preload']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'ocsp_stapling' => array( 'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd', 'label' => $lng['admin']['domain_ocsp_stapling']['title'], 'desc' => $lng['admin']['domain_ocsp_stapling']['description'] . (\Froxlor\Settings::Get('system.webserver') == 'nginx' ? $lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] : ""), 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'honorcipherorder' => array( 'visible' => ($ssl_ipsandports != '' ? true : false), 'label' => $lng['admin']['domain_honorcipherorder'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'sessiontickets' => array( 'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.sessionticketsenabled' != '1'), 'label' => $lng['admin']['domain_sessiontickets'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - '1' - ) + 'value' => '1', + 'checked' => true ) ) ), @@ -406,44 +314,31 @@ return array( 'openbasedir' => array( 'label' => 'OpenBasedir', 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - '1' - ) + 'value' => '1', + 'checked' => true ), 'phpenabled' => array( 'label' => $lng['admin']['phpenabled'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - '1' - ) + 'value' => '1', + 'checked' => true ), 'phpsettingid' => array( 'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) ? true : false), 'label' => $lng['admin']['phpsettings']['title'], 'type' => 'select', - 'select_var' => $phpconfigs + 'select_var' => $phpconfigs, + 'selected' => '@TODO' ), 'mod_fcgid_starter' => array( 'visible' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), 'label' => $lng['admin']['mod_fcgid_starter']['title'], - 'type' => 'text' + 'type' => 'number' ), 'mod_fcgid_maxrequests' => array( 'visible' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), 'label' => $lng['admin']['mod_fcgid_maxrequests']['title'], - 'type' => 'text' + 'type' => 'number' ) ) ), @@ -455,15 +350,8 @@ return array( 'isbinddomain' => array( 'label' => 'Nameserver', 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - '1' - ) + 'value' => '1', + 'checked' => true ), 'zonefile' => array( 'label' => 'Zonefile', @@ -479,45 +367,27 @@ return array( 'isemaildomain' => array( 'label' => $lng['admin']['emaildomain'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - '1' - ) + 'value' => '1', + 'checked' => true ), 'email_only' => array( 'label' => $lng['admin']['email_only'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'subcanemaildomain' => array( 'label' => $lng['admin']['subdomainforemail'], 'type' => 'select', - 'select_var' => $subcanemaildomain + 'select_var' => $subcanemaildomain, + 'selected' => '@TODO' ), 'dkim' => array( 'visible' => (\Froxlor\Settings::Get('dkim.use_dkim') == '1' ? true : false), 'label' => 'DomainKeys', 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - '1' - ) + 'value' => '1', + 'checked' => true ) ) ) diff --git a/lib/formfields/admin/domains/formfield.domains_edit.php b/lib/formfields/admin/domains/formfield.domains_edit.php index c53466cf..bcf3d32c 100644 --- a/lib/formfields/admin/domains/formfield.domains_edit.php +++ b/lib/formfields/admin/domains/formfield.domains_edit.php @@ -17,7 +17,7 @@ return array( 'domain_edit' => array( 'title' => $lng['admin']['domain_edit'], - 'image' => 'icons/domain_edit.png', + 'image' => 'fa-solid fa-globe', 'sections' => array( 'section_a' => array( 'title' => $lng['domains']['domainsettings'], @@ -33,7 +33,7 @@ return array( 'label' => $lng['admin']['customer'], 'type' => (\Froxlor\Settings::Get('panel.allow_domain_change_customer') == '1' ? 'select' : 'label'), 'select_var' => (isset($customers) ? $customers : null), - 'value' => (isset($result['customername']) ? $result['customername'] : null), + 'selected' => (isset($result['customername']) ? $result['customername'] : null), 'mandatory' => true ), 'adminid' => array( @@ -41,20 +41,22 @@ return array( 'label' => $lng['admin']['admin'], 'type' => (\Froxlor\Settings::Get('panel.allow_domain_change_admin') == '1' ? 'select' : 'label'), 'select_var' => (isset($admins) ? $admins : null), - 'value' => (isset($result['adminname']) ? $result['adminname'] : null), + 'selected' => (isset($result['adminname']) ? $result['adminname'] : null), 'mandatory' => true ), 'alias' => array( 'visible' => ($alias_check == '0' ? true : false), 'label' => $lng['domains']['aliasdomain'], 'type' => 'select', - 'select_var' => $domains + 'select_var' => $domains, + 'selected' => '@TODO' ), 'issubof' => array( 'label' => $lng['domains']['issubof'], 'desc' => $lng['domains']['issubofinfo'], 'type' => 'select', - 'select_var' => $subtodomains + 'select_var' => $subtodomains, + 'selected' => '@TODO' ), 'associated_info' => array( 'label' => $lng['domains']['associated_with_domain'], @@ -65,15 +67,8 @@ return array( 'label' => $lng['admin']['domain_editable']['title'], 'desc' => $lng['admin']['domain_editable']['desc'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['caneditdomain'] - ) + 'value' => '1', + 'checked' => $result['caneditdomain'] ), 'add_date' => array( 'label' => $lng['domains']['add_date'], @@ -121,25 +116,18 @@ return array( 'label' => $lng['admin']['selectserveralias'], 'desc' => $lng['admin']['selectserveralias_desc'], 'type' => 'select', - 'select_var' => $serveraliasoptions + 'select_var' => $serveraliasoptions, + 'selected' => '@TODO' ), 'speciallogfile' => array( 'label' => $lng['admin']['speciallogfile']['title'], 'desc' => $lng['admin']['speciallogfile']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['speciallogfile'] - ) + 'value' => '1', + 'checked' => $result['speciallogfile'] ), 'specialsettings' => array( 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), - 'style' => 'align-top', 'label' => $lng['admin']['ownvhostsettings'], 'desc' => $lng['serversettings']['default_vhostconf']['description'], 'type' => 'textarea', @@ -152,58 +140,30 @@ return array( 'label' => $lng['admin']['specialsettingsforsubdomains'], 'desc' => $lng['serversettings']['specialsettingsforsubdomains']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - \Froxlor\Settings::Get('system.apply_specialsettings_default') == 1 ? '1' : '' - ) + 'value' => '1', + 'checked' => \Froxlor\Settings::Get('system.apply_specialsettings_default') == 1 ? '1' : '0' ), 'notryfiles' => array( 'visible' => (\Froxlor\Settings::Get('system.webserver') == 'nginx' && $userinfo['change_serversettings'] == '1'), 'label' => $lng['admin']['notryfiles']['title'], 'desc' => $lng['admin']['notryfiles']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['notryfiles'] - ) + 'value' => '1', + 'checked' => $result['notryfiles'] ), 'writeaccesslog' => array( 'label' => $lng['admin']['writeaccesslog']['title'], 'desc' => $lng['admin']['writeaccesslog']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['writeaccesslog'] - ) + 'value' => '1', + 'checked' => $result['writeaccesslog'] ), 'writeerrorlog' => array( 'label' => $lng['admin']['writeerrorlog']['title'], 'desc' => $lng['admin']['writeerrorlog']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['writeerrorlog'] - ) + 'value' => '1', + 'checked' => $result['writeerrorlog'] ) ) ), @@ -216,15 +176,8 @@ return array( 'visible' => ($ssl_ipsandports != '' ? true : false), 'label' => $lng['admin']['domain_sslenabled'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['ssl_enabled'] - ) + 'value' => '1', + 'checked' => $result['ssl_enabled'] ), 'no_ssl_available_info' => array( 'visible' => ($ssl_ipsandports == '' ? true : false), @@ -245,59 +198,31 @@ return array( 'label' => $lng['domains']['ssl_redirect']['title'], 'desc' => $lng['domains']['ssl_redirect']['description'] . ($result['temporary_ssl_redirect'] > 1 ? $lng['domains']['ssl_redirect_temporarilydisabled'] : ''), 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['ssl_redirect'] - ) + 'value' => '1', + 'checked' => $result['ssl_redirect'] ), 'letsencrypt' => array( 'visible' => (\Froxlor\Settings::Get('system.leenabled') == '1' ? ($ssl_ipsandports != '' ? true : false) : false), 'label' => $lng['admin']['letsencrypt']['title'], 'desc' => $lng['admin']['letsencrypt']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['letsencrypt'] - ) + 'value' => '1', + 'checked' => $result['letsencrypt'] ), 'http2' => array( 'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1', 'label' => $lng['admin']['domain_http2']['title'], 'desc' => $lng['admin']['domain_http2']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['http2'] - ) + 'value' => '1', + 'checked' => $result['http2'] ), 'override_tls' => array( 'visible' => (($ssl_ipsandports != '' ? true : false) && $userinfo['change_serversettings'] == '1' ? true : false), 'label' => $lng['admin']['domain_override_tls'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['override_tls'] - ) + 'value' => '1', + 'checked' => $result['override_tls'] ), 'ssl_protocols' => array( 'visible' => (($ssl_ipsandports != '' ? true : false) && $userinfo['change_serversettings'] == '1' && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' ? true : false), @@ -308,19 +233,19 @@ return array( 'values' => array( array( 'value' => 'TLSv1', - 'label' => 'TLSv1
' + 'label' => 'TLSv1' ), array( 'value' => 'TLSv1.1', - 'label' => 'TLSv1.1
' + 'label' => 'TLSv1.1' ), array( 'value' => 'TLSv1.2', - 'label' => 'TLSv1.2
' + 'label' => 'TLSv1.2' ), array( 'value' => 'TLSv1.3', - 'label' => 'TLSv1.3
' + 'label' => 'TLSv1.3' ) ), 'is_array' => 1 @@ -341,7 +266,6 @@ return array( ), 'ssl_specialsettings' => array( 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), - 'style' => 'align-top', 'label' => $lng['admin']['ownsslvhostsettings'], 'desc' => $lng['serversettings']['default_vhostconf']['description'], 'type' => 'textarea', @@ -352,23 +276,16 @@ return array( 'include_specialsettings' => array( 'label' => $lng['admin']['include_ownvhostsettings'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['include_specialsettings'] - ) + 'value' => '1', + 'checked' => $result['include_specialsettings'] ), 'hsts_maxage' => array( 'visible' => ($ssl_ipsandports != '' ? true : false), 'label' => $lng['admin']['domain_hsts_maxage']['title'], 'desc' => $lng['admin']['domain_hsts_maxage']['description'], - 'type' => 'int', - 'int_min' => 0, - 'int_max' => 94608000, // 3-years + 'type' => 'number', + 'min' => 0, + 'max' => 94608000, // 3-years 'value' => $result['hsts'] ), 'hsts_sub' => array( @@ -376,73 +293,38 @@ return array( 'label' => $lng['admin']['domain_hsts_incsub']['title'], 'desc' => $lng['admin']['domain_hsts_incsub']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['hsts_sub'] - ) + 'value' => '1', + 'checked' => $result['hsts_sub'] ), 'hsts_preload' => array( 'visible' => ($ssl_ipsandports != '' ? true : false), 'label' => $lng['admin']['domain_hsts_preload']['title'], 'desc' => $lng['admin']['domain_hsts_preload']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['hsts_preload'] - ) + 'value' => '1', + 'checked' => $result['hsts_preload'] ), 'ocsp_stapling' => array( 'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd', 'label' => $lng['admin']['domain_ocsp_stapling']['title'], 'desc' => $lng['admin']['domain_ocsp_stapling']['description'] . (\Froxlor\Settings::Get('system.webserver') == 'nginx' ? $lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] : ""), 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['ocsp_stapling'] - ) + 'value' => '1', + 'checked' => $result['ocsp_stapling'] ), 'honorcipherorder' => array( 'visible' => ($ssl_ipsandports != '' ? true : false), 'label' => $lng['admin']['domain_honorcipherorder'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['ssl_honorcipherorder'] - ) + 'value' => '1', + 'checked' => $result['ssl_honorcipherorder'] ), 'sessiontickets' => array( 'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.sessionticketsenabled' != '1'), 'label' => $lng['admin']['domain_sessiontickets'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['ssl_sessiontickets'] - ) + 'value' => '1', + 'checked' => $result['ssl_sessiontickets'] ) ) ), @@ -454,60 +336,40 @@ return array( 'openbasedir' => array( 'label' => 'OpenBasedir', 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['openbasedir'] - ) + 'value' => '1', + 'checked' => $result['openbasedir'] ), 'phpenabled' => array( 'label' => $lng['admin']['phpenabled'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['phpenabled'] - ) + 'value' => '1', + 'checked' => $result['phpenabled'] ), 'phpsettingid' => array( 'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) ? true : false), 'label' => $lng['admin']['phpsettings']['title'], 'type' => 'select', - 'select_var' => $phpconfigs + 'select_var' => $phpconfigs, + 'selected' => '@TODO' ), 'phpsettingsforsubdomains' => array( 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), 'label' => $lng['admin']['phpsettingsforsubdomains'], 'desc' => $lng['serversettings']['phpsettingsforsubdomains']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - \Froxlor\Settings::Get('system.apply_phpconfigs_default') == 1 ? '1' : '' - ) + 'value' => '1', + 'checked' => \Froxlor\Settings::Get('system.apply_phpconfigs_default') == 1 ? '1' : '0' ), 'mod_fcgid_starter' => array( 'visible' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), 'label' => $lng['admin']['mod_fcgid_starter']['title'], - 'type' => 'text', + 'type' => 'number', 'value' => ((int) $result['mod_fcgid_starter'] != - 1 ? $result['mod_fcgid_starter'] : '') ), 'mod_fcgid_maxrequests' => array( 'visible' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), 'label' => $lng['admin']['mod_fcgid_maxrequests']['title'], - 'type' => 'text', + 'type' => 'number', 'value' => ((int) $result['mod_fcgid_maxrequests'] != - 1 ? $result['mod_fcgid_maxrequests'] : '') ) ) @@ -520,15 +382,8 @@ return array( 'isbinddomain' => array( 'label' => 'Nameserver', 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['isbinddomain'] - ) + 'value' => '1', + 'checked' => $result['isbinddomain'] ), 'zonefile' => array( 'label' => 'Zonefile', @@ -545,47 +400,27 @@ return array( 'isemaildomain' => array( 'label' => $lng['admin']['emaildomain'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['isemaildomain'] - ) + 'value' => '1', + 'checked' => $result['isemaildomain'] ), 'email_only' => array( 'label' => $lng['admin']['email_only'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['email_only'] - ) + 'value' => '1', + 'checked' => $result['email_only'] ), 'subcanemaildomain' => array( 'label' => $lng['admin']['subdomainforemail'], 'type' => 'select', - 'select_var' => $subcanemaildomain + 'select_var' => $subcanemaildomain, + 'selected' => '@TODO' ), 'dkim' => array( 'visible' => (\Froxlor\Settings::Get('dkim.use_dkim') == '1' ? true : false), 'label' => 'DomainKeys', 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['dkim'] - ) + 'value' => '1', + 'checked' => $result['dkim'] ) ) ) diff --git a/lib/formfields/admin/domains/formfield.domains_import.php b/lib/formfields/admin/domains/formfield.domains_import.php index fd7b3372..b0cf27dd 100644 --- a/lib/formfields/admin/domains/formfield.domains_import.php +++ b/lib/formfields/admin/domains/formfield.domains_import.php @@ -17,7 +17,7 @@ return array( 'domain_import' => array( 'title' => $lng['domains']['domain_import'], - 'image' => 'icons/domain_add.png', + 'image' => 'fa-solid fa-file-import', 'sections' => array( 'section_a' => array( 'title' => $lng['domains']['domain_import'], diff --git a/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php b/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php index 11fcba4a..30089163 100644 --- a/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php +++ b/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php @@ -17,7 +17,7 @@ return array( 'fpmconfig_add' => array( 'title' => $lng['admin']['phpsettings']['addsettings'], - 'image' => 'icons/phpsettings_add.png', + 'image' => 'fa-solid fa-plus', 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['phpsettings']['addsettings'], @@ -32,53 +32,56 @@ return array( 'label' => $lng['serversettings']['phpfpm_settings']['reload'], 'type' => 'text', 'maxlength' => 255, - 'value' => 'service php7.3-fpm restart' + 'value' => 'service php7.4-fpm restart' ), 'config_dir' => array( 'label' => $lng['serversettings']['phpfpm_settings']['configdir'], 'type' => 'text', 'maxlength' => 255, - 'value' => '/etc/php/7.3/fpm/pool.d/' + 'value' => '/etc/php/7.4/fpm/pool.d/' ), 'pm' => array( 'label' => $lng['serversettings']['phpfpm_settings']['pm'], 'type' => 'select', - 'select_var' => $pm_select + 'select_var' => $pm_select, + 'selected' => '@TODO' ), 'max_children' => array( 'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'], - 'type' => 'int', - 'value' => 5 + 'type' => 'number', + 'value' => 5, + 'min' => 1 ), 'start_servers' => array( 'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'], - 'type' => 'int', - 'value' => 2 + 'type' => 'number', + 'value' => 2, + 'min' => 1 ), 'min_spare_servers' => array( 'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'], - 'type' => 'int', + 'type' => 'number', 'value' => 1 ), 'max_spare_servers' => array( 'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'], - 'type' => 'int', + 'type' => 'number', 'value' => 3 ), 'max_requests' => array( 'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'], - 'type' => 'int', + 'type' => 'number', 'value' => 0 ), 'idle_timeout' => array( 'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'], - 'type' => 'int', + 'type' => 'number', 'value' => 10 ), 'limit_extensions' => array( diff --git a/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php b/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php index 78fdcf72..d963e785 100644 --- a/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php +++ b/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php @@ -17,7 +17,7 @@ return array( 'fpmconfig_edit' => array( 'title' => $lng['admin']['phpsettings']['editsettings'], - 'image' => 'icons/phpsettings_edit.png', + 'image' => 'fa-solid fa-pen', 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['phpsettings']['editsettings'], @@ -44,42 +44,45 @@ return array( 'pm' => array( 'label' => $lng['serversettings']['phpfpm_settings']['pm'], 'type' => 'select', - 'select_var' => $pm_select + 'select_var' => $pm_select, + 'selected' => '@TODO' ), 'max_children' => array( 'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'], - 'type' => 'int', - 'value' => $result['max_children'] + 'type' => 'number', + 'value' => $result['max_children'], + 'min' => 1 ), 'start_servers' => array( 'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'], - 'type' => 'int', - 'value' => $result['start_servers'] + 'type' => 'number', + 'value' => $result['start_servers'], + 'min' => 1 ), 'min_spare_servers' => array( 'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'], - 'type' => 'int', + 'type' => 'number', 'value' => $result['min_spare_servers'] ), 'max_spare_servers' => array( 'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'], - 'type' => 'int', + 'type' => 'number', 'value' => $result['max_spare_servers'] ), 'max_requests' => array( 'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'], - 'type' => 'int', + 'type' => 'number', 'value' => $result['max_requests'] ), 'idle_timeout' => array( 'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'], - 'type' => 'int', + 'type' => 'number', 'value' => $result['idle_timeout'] ), 'limit_extensions' => array( diff --git a/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php b/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php index 20d97b2f..e951f43f 100644 --- a/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php +++ b/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php @@ -17,7 +17,7 @@ return array( 'phpconfig_add' => array( 'title' => $lng['admin']['phpsettings']['addsettings'], - 'image' => 'icons/phpsettings_add.png', + 'image' => 'fa-solid fa-plus', 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['phpsettings']['addsettings'], @@ -39,7 +39,8 @@ return array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['admin']['phpsettings']['fpmdesc'], 'type' => 'select', - 'select_var' => $fpmconfigs + 'select_var' => $fpmconfigs, + 'selected' => '@TODO' ), 'file_extensions' => array( 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), @@ -52,12 +53,12 @@ return array( 'mod_fcgid_starter' => array( 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), 'label' => $lng['admin']['mod_fcgid_starter']['title'], - 'type' => 'text' + 'type' => 'number' ), 'mod_fcgid_maxrequests' => array( 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), 'label' => $lng['admin']['mod_fcgid_maxrequests']['title'], - 'type' => 'text' + 'type' => 'number' ), 'mod_fcgid_umask' => array( 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), @@ -70,13 +71,8 @@ return array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['admin']['phpsettings']['enable_slowlog'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'phpfpm_reqtermtimeout' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), @@ -96,73 +92,64 @@ return array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['admin']['phpsettings']['pass_authorizationheader'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'override_fpmconfig' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'pm' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['serversettings']['phpfpm_settings']['pm'], 'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'type' => 'select', - 'select_var' => $pm_select + 'select_var' => $pm_select, + 'selected' => '@TODO' ), 'max_children' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], - 'type' => 'int', + 'type' => 'number', 'value' => 1 ), 'start_servers' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], - 'type' => 'int', + 'type' => 'number', 'value' => 20 ), 'min_spare_servers' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], - 'type' => 'int', + 'type' => 'number', 'value' => 5 ), 'max_spare_servers' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], - 'type' => 'int', + 'type' => 'number', 'value' => 35 ), 'max_requests' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], - 'type' => 'int', + 'type' => 'number', 'value' => 0 ), 'idle_timeout' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], - 'type' => 'int', + 'type' => 'number', 'value' => 10 ), 'limit_extensions' => array( @@ -173,7 +160,6 @@ return array( 'value' => '.php' ), 'phpsettings' => array( - 'style' => 'align-top', 'label' => $lng['admin']['phpsettings']['phpinisettings'], 'type' => 'textarea', 'cols' => 80, @@ -184,13 +170,8 @@ return array( 'label' => $lng['serversettings']['phpfpm_settings']['allow_all_customers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['allow_all_customers']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ) ) ) diff --git a/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php b/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php index e8b54f92..e579a538 100644 --- a/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php +++ b/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php @@ -17,7 +17,7 @@ return array( 'phpconfig_edit' => array( 'title' => $lng['admin']['phpsettings']['editsettings'], - 'image' => 'icons/phpsettings_edit.png', + 'image' => 'fa-solid fa-pen', 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['phpsettings']['editsettings'], @@ -40,7 +40,8 @@ return array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['admin']['phpsettings']['fpmdesc'], 'type' => 'select', - 'select_var' => $fpmconfigs + 'select_var' => $fpmconfigs, + 'selected' => '@TODO' ), 'file_extensions' => array( 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), @@ -53,13 +54,13 @@ return array( 'mod_fcgid_starter' => array( 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), 'label' => $lng['admin']['mod_fcgid_starter']['title'], - 'type' => 'text', + 'type' => 'number', 'value' => ((int) $result['mod_fcgid_starter'] != - 1 ? $result['mod_fcgid_starter'] : '') ), 'mod_fcgid_maxrequests' => array( 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), 'label' => $lng['admin']['mod_fcgid_maxrequests']['title'], - 'type' => 'text', + 'type' => 'number', 'value' => ((int) $result['mod_fcgid_maxrequests'] != - 1 ? $result['mod_fcgid_maxrequests'] : '') ), 'mod_fcgid_umask' => array( @@ -73,15 +74,8 @@ return array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['admin']['phpsettings']['enable_slowlog'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['fpm_slowlog'] - ) + 'value' => '1', + 'checked' => $result['fpm_slowlog'] ), 'phpfpm_reqtermtimeout' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), @@ -101,76 +95,63 @@ return array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['admin']['phpsettings']['pass_authorizationheader'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['pass_authorizationheader'] - ) + 'value' => '1', + 'checked' => $result['pass_authorizationheader'] ), 'override_fpmconfig' => array( 'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['override_fpmconfig'] - ) + 'value' => '1', + 'checked' => $result['override_fpmconfig'] ), 'pm' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['serversettings']['phpfpm_settings']['pm'], 'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'type' => 'select', - 'select_var' => $pm_select + 'select_var' => $pm_select, + 'selected' => '@TODO' ), 'max_children' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], - 'type' => 'int', + 'type' => 'number', 'value' => $result['max_children'] ), 'start_servers' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], - 'type' => 'int', + 'type' => 'number', 'value' => $result['start_servers'] ), 'min_spare_servers' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], - 'type' => 'int', + 'type' => 'number', 'value' => $result['min_spare_servers'] ), 'max_spare_servers' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], - 'type' => 'int', + 'type' => 'number', 'value' => $result['max_spare_servers'] ), 'max_requests' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], - 'type' => 'int', + 'type' => 'number', 'value' => $result['max_requests'] ), 'idle_timeout' => array( 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], - 'type' => 'int', + 'type' => 'number', 'value' => $result['idle_timeout'] ), 'limit_extensions' => array( @@ -181,7 +162,6 @@ return array( 'value' => $result['limit_extensions'] ), 'phpsettings' => array( - 'style' => 'align-top', 'label' => $lng['admin']['phpsettings']['phpinisettings'], 'type' => 'textarea', 'cols' => 80, @@ -192,13 +172,8 @@ return array( 'label' => $lng['serversettings']['phpfpm_settings']['allow_all_customers']['title'], 'desc' => $lng['serversettings']['phpfpm_settings']['allow_all_customers']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ) ) ) diff --git a/lib/formfields/admin/plans/formfield.plans_add.php b/lib/formfields/admin/plans/formfield.plans_add.php index 7228ba32..71a43129 100644 --- a/lib/formfields/admin/plans/formfield.plans_add.php +++ b/lib/formfields/admin/plans/formfield.plans_add.php @@ -17,7 +17,7 @@ return array( 'plans_add' => array( 'title' => $lng['admin']['plans']['add'], - 'image' => 'icons/templates_add_big.png', + 'image' => 'fa-solid fa-plus', 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['plans']['plan_details'], diff --git a/lib/formfields/admin/plans/formfield.plans_edit.php b/lib/formfields/admin/plans/formfield.plans_edit.php index 5efb6b2c..5c84d84e 100644 --- a/lib/formfields/admin/plans/formfield.plans_edit.php +++ b/lib/formfields/admin/plans/formfield.plans_edit.php @@ -17,7 +17,7 @@ return array( 'plans_edit' => array( 'title' => $lng['admin']['plans']['edit'], - 'image' => 'icons/templates_edit_big.png', + 'image' => 'fa-solid fa-pen', 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['plans']['plan_details'], diff --git a/lib/formfields/admin/templates/formfield.filetemplate_add.php b/lib/formfields/admin/templates/formfield.filetemplate_add.php index ace5c880..8af538b0 100644 --- a/lib/formfields/admin/templates/formfield.filetemplate_add.php +++ b/lib/formfields/admin/templates/formfield.filetemplate_add.php @@ -17,7 +17,7 @@ return array( 'filetemplate_add' => array( 'title' => $lng['admin']['templates']['template_add'], - 'image' => 'icons/templates_add.png', + 'image' => 'fa-solid fa-plus', 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['templates']['template_add'], @@ -26,7 +26,8 @@ return array( 'template' => array( 'label' => $lng['admin']['templates']['action'], 'type' => 'select', - 'select_var' => $free_templates + 'select_var' => $free_templates, + 'selected' => '@TODO' ), 'filecontent' => array( 'label' => $lng['admin']['templates']['filecontent'], diff --git a/lib/formfields/admin/templates/formfield.filetemplate_edit.php b/lib/formfields/admin/templates/formfield.filetemplate_edit.php index 91d6885b..8459a890 100644 --- a/lib/formfields/admin/templates/formfield.filetemplate_edit.php +++ b/lib/formfields/admin/templates/formfield.filetemplate_edit.php @@ -17,7 +17,7 @@ return array( 'filetemplate_edit' => array( 'title' => $lng['admin']['templates']['template_edit'], - 'image' => 'icons/templates_edit.png', + 'image' => 'fa-solid fa-pen', 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['templates']['template_edit'], diff --git a/lib/formfields/admin/templates/formfield.template_add.php b/lib/formfields/admin/templates/formfield.template_add.php index ce9c277f..a47d752d 100644 --- a/lib/formfields/admin/templates/formfield.template_add.php +++ b/lib/formfields/admin/templates/formfield.template_add.php @@ -17,7 +17,7 @@ return array( 'template_add' => array( 'title' => $lng['admin']['templates']['template_add'], - 'image' => 'icons/templates_add.png', + 'image' => 'fa-solid fa-plus', 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['templates']['template_add'], diff --git a/lib/formfields/admin/templates/formfield.template_edit.php b/lib/formfields/admin/templates/formfield.template_edit.php index d6b1c70a..c3b9ef19 100644 --- a/lib/formfields/admin/templates/formfield.template_edit.php +++ b/lib/formfields/admin/templates/formfield.template_edit.php @@ -17,7 +17,7 @@ return array( 'template_edit' => array( 'title' => $lng['admin']['templates']['template_edit'], - 'image' => 'icons/templates_edit.png', + 'image' => 'fa-solid fa-pen', 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['templates']['template_edit'], diff --git a/lib/formfields/customer/domains/formfield.domain_ssleditor.php b/lib/formfields/customer/domains/formfield.domain_ssleditor.php index 3518ef39..d2f0a42d 100644 --- a/lib/formfields/customer/domains/formfield.domain_ssleditor.php +++ b/lib/formfields/customer/domains/formfield.domain_ssleditor.php @@ -17,7 +17,7 @@ return array( 'domain_ssleditor' => array( 'title' => $lng['panel']['ssleditor'], - 'image' => 'icons/ssl.png', + 'image' => 'fa-solid fa-lock', 'sections' => array( 'section_a' => array( 'title' => 'SSL certificates', @@ -30,7 +30,6 @@ return array( 'display' => $result_domain['domain'] ), 'ssl_cert_file' => array( - 'style' => 'align-top', 'label' => $lng['admin']['ipsandports']['ssl_cert_file_content'], 'desc' => $lng['admin']['ipsandports']['ssl_paste_description'], 'type' => 'textarea', @@ -39,7 +38,6 @@ return array( 'value' => $result['ssl_cert_file'] ), 'ssl_key_file' => array( - 'style' => 'align-top', 'label' => $lng['admin']['ipsandports']['ssl_key_file_content'], 'desc' => $lng['admin']['ipsandports']['ssl_paste_description'], 'type' => 'textarea', @@ -48,7 +46,6 @@ return array( 'value' => $result['ssl_key_file'] ), 'ssl_cert_chainfile' => array( - 'style' => 'align-top', 'label' => $lng['admin']['ipsandports']['ssl_cert_chainfile_content'], 'desc' => $lng['admin']['ipsandports']['ssl_paste_description'] . $lng['admin']['ipsandports']['ssl_cert_chainfile_content_desc'], 'type' => 'textarea', @@ -57,7 +54,6 @@ return array( 'value' => $result['ssl_cert_chainfile'] ), 'ssl_ca_file' => array( - 'style' => 'align-top', 'label' => $lng['admin']['ipsandports']['ssl_ca_file_content'], 'desc' => $lng['admin']['ipsandports']['ssl_paste_description'] . $lng['admin']['ipsandports']['ssl_ca_file_content_desc'], 'type' => 'textarea', diff --git a/lib/formfields/customer/domains/formfield.domains_add.php b/lib/formfields/customer/domains/formfield.domains_add.php index 577a0c03..ed283c13 100644 --- a/lib/formfields/customer/domains/formfield.domains_add.php +++ b/lib/formfields/customer/domains/formfield.domains_add.php @@ -17,7 +17,7 @@ return array( 'domain_add' => array( 'title' => $lng['domains']['subdomain_add'], - 'image' => 'icons/domain_add.png', + 'image' => 'fa-solid fa-plus', 'sections' => array( 'section_a' => array( 'title' => $lng['domains']['subdomain_add'], @@ -25,15 +25,14 @@ return array( 'fields' => array( 'subdomain' => array( 'label' => $lng['domains']['domainname'], - 'type' => 'textul', - 'ul_field' => '', - 'has_nextto' => true - ), - 'domain' => array( - 'next_to' => 'subdomain', - 'next_to_prefix' => ' . ', - 'type' => 'select', - 'select_var' => $domains + 'type' => 'text', + 'next_to' => [ + 'domain' => [ + 'next_to_prefix' => ' . ', + 'type' => 'select', + 'select_var' => $domains + ] + ] ), 'alias' => array( 'label' => $lng['domains']['aliasdomain'], @@ -45,7 +44,7 @@ return array( 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null) . (isset($pathSelect['note']) ? $pathSelect['note'] . '
' . $pathSelect['value'] : ''), 'type' => $pathSelect['type'], 'select_var' => $pathSelect['value'], - 'value' => $pathSelect['value'] + 'selected' => $pathSelect['value'] ), 'url' => array( 'visible' => (\Froxlor\Settings::Get('panel.pathedit') == 'Dropdown' ? true : false), @@ -86,85 +85,53 @@ return array( 'sslenabled' => array( 'label' => $lng['admin']['domain_sslenabled'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - '1' - ) + 'value' => '1', + 'checked' => true ), 'ssl_redirect' => array( 'label' => $lng['domains']['ssl_redirect']['title'], 'desc' => $lng['domains']['ssl_redirect']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'letsencrypt' => array( 'visible' => (\Froxlor\Settings::Get('system.leenabled') == '1' ? true : false), 'label' => $lng['customer']['letsencrypt']['title'], 'desc' => $lng['customer']['letsencrypt']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'http2' => array( 'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1', 'label' => $lng['admin']['domain_http2']['title'], 'desc' => $lng['admin']['domain_http2']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'hsts_maxage' => array( 'label' => $lng['admin']['domain_hsts_maxage']['title'], 'desc' => $lng['admin']['domain_hsts_maxage']['description'], - 'type' => 'int', - 'int_min' => 0, - 'int_max' => 94608000, // 3-years + 'type' => 'number', + 'min' => 0, + 'max' => 94608000, // 3-years 'value' => 0 ), 'hsts_sub' => array( 'label' => $lng['admin']['domain_hsts_incsub']['title'], 'desc' => $lng['admin']['domain_hsts_incsub']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ), 'hsts_preload' => array( 'label' => $lng['admin']['domain_hsts_preload']['title'], 'desc' => $lng['admin']['domain_hsts_preload']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ) ) ) diff --git a/lib/formfields/customer/domains/formfield.domains_edit.php b/lib/formfields/customer/domains/formfield.domains_edit.php index d9b77ce8..b3624b46 100644 --- a/lib/formfields/customer/domains/formfield.domains_edit.php +++ b/lib/formfields/customer/domains/formfield.domains_edit.php @@ -17,7 +17,7 @@ return array( 'domain_edit' => array( 'title' => $lng['domains']['subdomain_edit'], - 'image' => 'icons/domain_edit.png', + 'image' => 'fa-solid fa-pen', 'sections' => array( 'section_a' => array( 'title' => $lng['domains']['subdomain_edit'], @@ -44,7 +44,7 @@ return array( 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null) . (isset($pathSelect['note']) ? '
' . $pathSelect['value'] : ''), 'type' => $pathSelect['type'], 'select_var' => $pathSelect['value'], - 'value' => $pathSelect['value'] + 'selected' => $pathSelect['value'] ), 'url' => array( 'visible' => (\Froxlor\Settings::Get('panel.pathedit') == 'Dropdown' ? true : false), @@ -70,15 +70,8 @@ return array( 'visible' => ((($result['subcanemaildomain'] == '1' || $result['subcanemaildomain'] == '2') && $result['parentdomainid'] != '0') ? true : false), 'label' => 'Emaildomain', 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['isemaildomain'] - ) + 'value' => '1', + 'checked' => $result['isemaildomain'] ), 'openbasedir_path' => array( 'visible' => ($result['openbasedir'] == '1') ? true : false, @@ -102,95 +95,53 @@ return array( 'sslenabled' => array( 'label' => $lng['admin']['domain_sslenabled'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['ssl_enabled'] - ) + 'value' => '1', + 'checked' => $result['ssl_enabled'] ), 'ssl_redirect' => array( 'label' => $lng['domains']['ssl_redirect']['title'], 'desc' => $lng['domains']['ssl_redirect']['description'] . ($result['temporary_ssl_redirect'] > 1 ? $lng['domains']['ssl_redirect_temporarilydisabled'] : ''), 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['ssl_redirect'] - ) + 'value' => '1', + 'checked' => $result['ssl_redirect'] ), 'letsencrypt' => array( 'visible' => \Froxlor\Settings::Get('system.leenabled') == '1' ? true : false, 'label' => $lng['customer']['letsencrypt']['title'], 'desc' => $lng['customer']['letsencrypt']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['letsencrypt'] - ) + 'value' => '1', + 'checked' => $result['letsencrypt'] ), 'http2' => array( 'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1', 'label' => $lng['admin']['domain_http2']['title'], 'desc' => $lng['admin']['domain_http2']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['http2'] - ) + 'value' => '1', + 'checked' => $result['http2'] ), 'hsts_maxage' => array( 'label' => $lng['admin']['domain_hsts_maxage']['title'], 'desc' => $lng['admin']['domain_hsts_maxage']['description'], - 'type' => 'int', - 'int_min' => 0, - 'int_max' => 94608000, // 3-years + 'type' => 'number', + 'min' => 0, + 'max' => 94608000, // 3-years 'value' => $result['hsts'] ), 'hsts_sub' => array( 'label' => $lng['admin']['domain_hsts_incsub']['title'], 'desc' => $lng['admin']['domain_hsts_incsub']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['hsts_sub'] - ) + 'value' => '1', + 'checked' => $result['hsts_sub'] ), 'hsts_preload' => array( 'label' => $lng['admin']['domain_hsts_preload']['title'], 'desc' => $lng['admin']['domain_hsts_preload']['description'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array( - $result['hsts_preload'] - ) + 'value' => '1', + 'checked' => $result['hsts_preload'] ) ) ) diff --git a/lib/formfields/customer/email/formfield.emails_add.php b/lib/formfields/customer/email/formfield.emails_add.php index 514306ef..de97ec66 100644 --- a/lib/formfields/customer/email/formfield.emails_add.php +++ b/lib/formfields/customer/email/formfield.emails_add.php @@ -17,7 +17,7 @@ return array( 'emails_add' => array( 'title' => $lng['emails']['emails_add'], - 'image' => 'icons/email_add.png', + 'image' => 'fa-solid fa-plus', 'sections' => array( 'section_a' => array( 'title' => $lng['emails']['emails_add'], @@ -25,26 +25,20 @@ return array( 'fields' => array( 'email_part' => array( 'label' => $lng['emails']['emailaddress'], - 'type' => 'textul', - 'ul_field' => '', - 'has_nextto' => true - ), - 'domain' => array( - 'next_to' => 'email_part', - 'next_to_prefix' => ' @ ', - 'type' => 'select', - 'select_var' => $domains + 'type' => 'text', + 'next_to' => [ + 'domain' => [ + 'next_to_prefix' => ' @ ', + 'type' => 'select', + 'select_var' => $domains + ] + ] ), 'iscatchall' => array( 'label' => $lng['emails']['iscatchall'], 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() + 'value' => '1', + 'checked' => false ) ) ) diff --git a/lib/formfields/customer/email/formfield.emails_edit.php b/lib/formfields/customer/email/formfield.emails_edit.php index 6e687681..f70dbc44 100644 --- a/lib/formfields/customer/email/formfield.emails_edit.php +++ b/lib/formfields/customer/email/formfield.emails_edit.php @@ -17,7 +17,7 @@ return array( 'emails_edit' => array( 'title' => $lng['emails']['emails_edit'], - 'image' => 'icons/email_edit.png', + 'image' => 'fa-solid fa-pen', 'sections' => array( 'section_a' => array( 'title' => $lng['emails']['emails_edit'], @@ -33,29 +33,69 @@ return array( 'visible' => ($result['popaccountid'] != 0 ? true : false), 'label' => $lng['emails']['account'], 'type' => 'label', - 'value' => $lng['panel']['yes'] . ' [' . $lng['menue']['main']['changepassword'] . '] [' . $lng['emails']['account_delete'] . ']' + 'value' => $lng['panel']['yes'], + 'next_to' => [ + 'del_link' => [ + 'type' => 'link', + 'href' => $filename . '?page=accounts&action=changepw&id=' . $result['id'] . '&s=' . $s, + 'label' => $lng['emails']['account_delete'], + 'classes' => 'btn btn-sm btn-danger' + ] + ] ), 'account_no' => array( 'visible' => ($result['popaccountid'] == 0 ? true : false), 'label' => $lng['emails']['account'], 'type' => 'label', - 'value' => $lng['panel']['no'] . ' [' . $lng['emails']['account_add'] . ']' + 'value' => $lng['panel']['no'], + 'next_to' => [ + 'add_link' => [ + 'type' => 'link', + 'href' => $filename . '?page=accounts&action=add&id=' . $result['id'] . '&s=' . $s, + 'label' => $lng['emails']['account_add'], + 'classes' => 'btn btn-sm btn-primary' + ] + ] ), 'mail_quota' => array( 'visible' => ($result['popaccountid'] != 0 && \Froxlor\Settings::Get('system.mail_quota_enabled')), 'label' => $lng['customer']['email_quota'], 'type' => 'label', - 'value' => $result['quota'] . ' MiB [' . $lng['emails']['quota_edit'] . ']' + 'value' => $result['quota'] . ' MiB', + 'next_to' => [ + 'add_link' => [ + 'type' => 'link', + 'href' => $filename . '?page=accounts&action=changequota&id=' . $result['id'] . '&s=' . $s, + 'label' => $lng['emails']['quota_edit'], + 'classes' => 'btn btn-sm btn-secondary' + ] + ] ), 'mail_catchall' => array( 'label' => $lng['emails']['catchall'], 'type' => 'label', - 'value' => ($result['iscatchall'] == 0 ? $lng['panel']['no'] : $lng['panel']['yes']) . ' [' . $lng['panel']['toggle'] . ']' + 'value' => ($result['iscatchall'] == 0 ? $lng['panel']['no'] : $lng['panel']['yes']), + 'next_to' => [ + 'add_link' => [ + 'type' => 'link', + 'href' => $filename . '?page=' . $page . '&action=togglecatchall&id=' . $result['id'] . '&s=' . $s, + 'label' => $lng['panel']['toggle'], + 'classes' => 'btn btn-sm btn-secondary' + ] + ] ), 'mail_fwds' => array( 'label' => $lng['emails']['forwarders'] . ' (' . $forwarders_count . ')', 'type' => 'label', - 'value' => $forwarders . ' ' . $lng['emails']['forwarder_add'] . '' + 'value' => $forwarders, + 'next_to' => [ + 'add_link' => [ + 'type' => 'link', + 'href' => $filename . '?page=forwarders&action=add&id=' . $result['id'] . '&s=' . $s, + 'label' => $lng['emails']['forwarder_add'], + 'classes' => 'btn btn-sm btn-primary' + ] + ] ) ) ) diff --git a/templates/Froxlor/form/form.html.twig b/templates/Froxlor/form/form.html.twig index 4140c1ab..331f0ef7 100644 --- a/templates/Froxlor/form/form.html.twig +++ b/templates/Froxlor/form/form.html.twig @@ -24,19 +24,7 @@ {% endif %}
{% for id,field in section.fields %} - {% if field.type == 'text' or field.type == 'password' or field.type == 'number' %} - {{ formfields.input(id, field) }} - {% elseif field.type == 'textul' %} - {{ formfields.input_ul(id, field) }} - {% elseif field.type == 'checkbox' %} - {{ formfields.bool(id, field) }} - {% elseif field.type == 'select' %} - {{ formfields.select(id, field) }} - {% elseif field.type == 'textarea' %} - {{ formfields.textarea(id, field) }} - {% elseif field.type == 'label' %} - {{ formfields.plain(id, field) }} - {% endif %} + {{ formfields.fieldrow(id, field) }} {% endfor %}
diff --git a/templates/Froxlor/form/formfields.html.twig b/templates/Froxlor/form/formfields.html.twig index 84bfb998..f7076a2a 100644 --- a/templates/Froxlor/form/formfields.html.twig +++ b/templates/Froxlor/form/formfields.html.twig @@ -1,50 +1,83 @@ -{% macro bool(id, field) %} -
-