remove unnecessary ternaries (#1027)
* remove unnecessary ternaries * fix: !($id <= 0); * remove ternary
This commit is contained in:
@@ -51,12 +51,12 @@ return array(
|
||||
'note' => $pathSelect['note'] ?? '',
|
||||
),
|
||||
'url' => array(
|
||||
'visible' => (Settings::Get('panel.pathedit') == 'Dropdown' ? true : false),
|
||||
'visible' => Settings::Get('panel.pathedit') == 'Dropdown',
|
||||
'label' => $lng['panel']['urloverridespath'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'redirectcode' => array(
|
||||
'visible' => (Settings::Get('customredirect.enabled') == '1' ? true : false),
|
||||
'visible' => Settings::Get('customredirect.enabled') == '1',
|
||||
'label' => $lng['domains']['redirectifpathisurl'],
|
||||
'desc' => $lng['domains']['redirectifpathisurlinfo'],
|
||||
'type' => 'select',
|
||||
@@ -74,7 +74,7 @@ return array(
|
||||
'select_var' => $openbasedir
|
||||
),
|
||||
'phpsettingid' => array(
|
||||
'visible' => (((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0 ? true : false),
|
||||
'visible' => ((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0,
|
||||
'label' => $lng['admin']['phpsettings']['title'],
|
||||
'type' => 'select',
|
||||
'select_var' => $phpconfigs,
|
||||
@@ -85,7 +85,7 @@ return array(
|
||||
'section_bssl' => array(
|
||||
'title' => $lng['admin']['webserversettings_ssl'],
|
||||
'image' => 'icons/domain_add.png',
|
||||
'visible' => Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports ? true : false) : false,
|
||||
'visible' => Settings::Get('system.use_ssl') == '1' && $ssl_ipsandports,
|
||||
'fields' => array(
|
||||
'sslenabled' => array(
|
||||
'label' => $lng['admin']['domain_sslenabled'],
|
||||
@@ -101,7 +101,7 @@ return array(
|
||||
'checked' => false
|
||||
),
|
||||
'letsencrypt' => array(
|
||||
'visible' => (Settings::Get('system.leenabled') == '1' ? true : false),
|
||||
'visible' => Settings::Get('system.leenabled') == '1',
|
||||
'label' => $lng['customer']['letsencrypt']['title'],
|
||||
'desc' => $lng['customer']['letsencrypt']['description'],
|
||||
'type' => 'checkbox',
|
||||
@@ -109,7 +109,7 @@ return array(
|
||||
'checked' => false
|
||||
),
|
||||
'http2' => array(
|
||||
'visible' => ($ssl_ipsandports ? true : false) && Settings::Get('system.webserver') != 'lighttpd' && Settings::Get('system.http2_support') == '1',
|
||||
'visible' => $ssl_ipsandports && Settings::Get('system.webserver') != 'lighttpd' && Settings::Get('system.http2_support') == '1',
|
||||
'label' => $lng['admin']['domain_http2']['title'],
|
||||
'desc' => $lng['admin']['domain_http2']['description'],
|
||||
'type' => 'checkbox',
|
||||
|
||||
@@ -34,7 +34,7 @@ return array(
|
||||
'values' => $domainips
|
||||
),
|
||||
'alias' => array(
|
||||
'visible' => ($alias_check == '0' ? true : false),
|
||||
'visible' => $alias_check == '0',
|
||||
'label' => $lng['domains']['aliasdomain'],
|
||||
'type' => 'select',
|
||||
'select_var' => $domains,
|
||||
@@ -48,13 +48,13 @@ return array(
|
||||
'selected' => $pathSelect['value']
|
||||
),
|
||||
'url' => array(
|
||||
'visible' => (\Froxlor\Settings::Get('panel.pathedit') == 'Dropdown' ? true : false),
|
||||
'visible' => \Froxlor\Settings::Get('panel.pathedit') == 'Dropdown',
|
||||
'label' => $lng['panel']['urloverridespath'],
|
||||
'type' => 'text',
|
||||
'value' => $urlvalue
|
||||
),
|
||||
'redirectcode' => array(
|
||||
'visible' => (\Froxlor\Settings::Get('customredirect.enabled') == '1' ? true : false),
|
||||
'visible' => \Froxlor\Settings::Get('customredirect.enabled') == '1',
|
||||
'label' => $lng['domains']['redirectifpathisurl'],
|
||||
'desc' => $lng['domains']['redirectifpathisurlinfo'],
|
||||
'type' => 'select',
|
||||
@@ -62,7 +62,7 @@ return array(
|
||||
'selected' => $def_code
|
||||
),
|
||||
'selectserveralias' => array(
|
||||
'visible' => ((($result['parentdomainid'] == '0' && $userinfo['subdomains'] != '0') || $result['parentdomainid'] != '0') ? true : false),
|
||||
'visible' => ($result['parentdomainid'] == '0' && $userinfo['subdomains'] != '0') || $result['parentdomainid'] != '0',
|
||||
'label' => $lng['admin']['selectserveralias'],
|
||||
'desc' => $lng['admin']['selectserveralias_desc'],
|
||||
'type' => 'select',
|
||||
@@ -70,21 +70,21 @@ return array(
|
||||
'selected' => $serveraliasoptions_selected
|
||||
),
|
||||
'isemaildomain' => array(
|
||||
'visible' => ((($result['subcanemaildomain'] == '1' || $result['subcanemaildomain'] == '2') && $result['parentdomainid'] != '0') ? true : false),
|
||||
'visible' => ($result['subcanemaildomain'] == '1' || $result['subcanemaildomain'] == '2') && $result['parentdomainid'] != '0',
|
||||
'label' => 'Emaildomain',
|
||||
'type' => 'checkbox',
|
||||
'value' => '1',
|
||||
'checked' => $result['isemaildomain']
|
||||
),
|
||||
'openbasedir_path' => array(
|
||||
'visible' => ($result['openbasedir'] == '1') ? true : false,
|
||||
'visible' => $result['openbasedir'] == '1',
|
||||
'label' => $lng['domain']['openbasedirpath'],
|
||||
'type' => 'select',
|
||||
'select_var' => $openbasedir,
|
||||
'selected' => $result['openbasedir_path']
|
||||
),
|
||||
'phpsettingid' => array(
|
||||
'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0 ? true : false),
|
||||
'visible' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) && count($phpconfigs) > 0,
|
||||
'label' => $lng['admin']['phpsettings']['title'],
|
||||
'type' => 'select',
|
||||
'select_var' => $phpconfigs,
|
||||
@@ -95,7 +95,7 @@ return array(
|
||||
'section_bssl' => array(
|
||||
'title' => $lng['admin']['webserversettings_ssl'],
|
||||
'image' => 'icons/domain_edit.png',
|
||||
'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports ? (\Froxlor\Domain\Domain::domainHasSslIpPort($result['id']) ? true : false) : false) : false,
|
||||
'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' && $ssl_ipsandports && \Froxlor\Domain\Domain::domainHasSslIpPort($result['id']),
|
||||
'fields' => array(
|
||||
'sslenabled' => array(
|
||||
'label' => $lng['admin']['domain_sslenabled'],
|
||||
@@ -111,7 +111,7 @@ return array(
|
||||
'checked' => $result['ssl_redirect']
|
||||
),
|
||||
'letsencrypt' => array(
|
||||
'visible' => \Froxlor\Settings::Get('system.leenabled') == '1' ? true : false,
|
||||
'visible' => \Froxlor\Settings::Get('system.leenabled') == '1',
|
||||
'label' => $lng['customer']['letsencrypt']['title'],
|
||||
'desc' => $lng['customer']['letsencrypt']['description'],
|
||||
'type' => 'checkbox',
|
||||
@@ -119,7 +119,7 @@ return array(
|
||||
'checked' => $result['letsencrypt']
|
||||
),
|
||||
'http2' => array(
|
||||
'visible' => ($ssl_ipsandports ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1',
|
||||
'visible' => $ssl_ipsandports && \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',
|
||||
|
||||
@@ -43,14 +43,14 @@ return array(
|
||||
]
|
||||
),
|
||||
'email_quota' => array(
|
||||
'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false),
|
||||
'visible' => \Froxlor\Settings::Get('system.mail_quota_enabled') == '1',
|
||||
'label' => $lng['emails']['quota'],
|
||||
'desc' => "MiB",
|
||||
'type' => 'number',
|
||||
'value' => $quota
|
||||
),
|
||||
'alternative_email' => array(
|
||||
'visible' => (\Froxlor\Settings::Get('panel.sendalternativemail') == '1' ? true : false),
|
||||
'visible' => \Froxlor\Settings::Get('panel.sendalternativemail') == '1',
|
||||
'label' => $lng['emails']['alternative_emailaddress'],
|
||||
'type' => 'text'
|
||||
)
|
||||
|
||||
@@ -30,7 +30,7 @@ return array(
|
||||
'value' => $result['email_full']
|
||||
),
|
||||
'account_yes' => array(
|
||||
'visible' => ((int) $result['popaccountid'] != 0 ? true : false),
|
||||
'visible' => (int) $result['popaccountid'] != 0,
|
||||
'label' => $lng['emails']['account'],
|
||||
'type' => 'label',
|
||||
'value' => $lng['panel']['yes'],
|
||||
@@ -50,7 +50,7 @@ return array(
|
||||
]
|
||||
),
|
||||
'account_no' => array(
|
||||
'visible' => ((int) $result['popaccountid'] == 0 ? true : false),
|
||||
'visible' => (int) $result['popaccountid'] == 0,
|
||||
'label' => $lng['emails']['account'],
|
||||
'type' => 'label',
|
||||
'value' => $lng['panel']['no'],
|
||||
|
||||
@@ -23,7 +23,7 @@ return array(
|
||||
'image' => 'icons/user_add.png',
|
||||
'fields' => array(
|
||||
'ftp_username' => array(
|
||||
'visible' => (\Froxlor\Settings::Get('customer.ftpatdomain') == '1' ? true : false),
|
||||
'visible' => \Froxlor\Settings::Get('customer.ftpatdomain') == '1',
|
||||
'label' => $lng['login']['username'],
|
||||
'type' => 'text',
|
||||
'next_to' => (\Froxlor\Settings::Get('customer.ftpatdomain') == '1' && count($domainlist) > 0 ? [
|
||||
@@ -66,7 +66,7 @@ return array(
|
||||
'checked' => false
|
||||
),
|
||||
'shell' => array(
|
||||
'visible' => (\Froxlor\Settings::Get('system.allow_customer_shell') == '1' ? true : false),
|
||||
'visible' => \Froxlor\Settings::Get('system.allow_customer_shell') == '1',
|
||||
'label' => $lng['panel']['shell'],
|
||||
'type' => 'select',
|
||||
'select_var' => $shells_avail,
|
||||
|
||||
@@ -53,7 +53,7 @@ return array(
|
||||
'value' => \Froxlor\System\Crypt::generatePassword()
|
||||
),
|
||||
'shell' => array(
|
||||
'visible' => (\Froxlor\Settings::Get('system.allow_customer_shell') == '1' ? true : false),
|
||||
'visible' => \Froxlor\Settings::Get('system.allow_customer_shell') == '1',
|
||||
'label' => $lng['panel']['shell'],
|
||||
'type' => 'select',
|
||||
'select_var' => $shells_avail,
|
||||
|
||||
@@ -25,7 +25,7 @@ return array(
|
||||
'image' => 'icons/mysql_add.png',
|
||||
'fields' => array(
|
||||
'custom_suffix' => array(
|
||||
'visible' => (strtoupper(Settings::Get('customer.mysqlprefix')) == 'DBNAME') ? true : false,
|
||||
'visible' => strtoupper(Settings::Get('customer.mysqlprefix')) == 'DBNAME',
|
||||
'label' => $lng['mysql']['databasename'],
|
||||
'type' => 'text'
|
||||
),
|
||||
@@ -34,7 +34,7 @@ return array(
|
||||
'type' => 'text'
|
||||
),
|
||||
'mysql_server' => array(
|
||||
'visible' => (count($mysql_servers) > 1 ? true : false),
|
||||
'visible' => count($mysql_servers) > 1,
|
||||
'label' => $lng['mysql']['mysql_server'],
|
||||
'type' => 'select',
|
||||
'select_var' => $mysql_servers
|
||||
|
||||
@@ -33,7 +33,7 @@ return array(
|
||||
'value' => $result['description']
|
||||
),
|
||||
'mysql_server' => array(
|
||||
'visible' => ($count_mysql_servers > 1 ? true : false),
|
||||
'visible' => $count_mysql_servers > 1,
|
||||
'label' => $lng['mysql']['mysql_server'],
|
||||
'type' => 'label',
|
||||
'value' => $sql_root['caption']
|
||||
|
||||
Reference in New Issue
Block a user