remove unnecessary ternaries (#1027)

* remove unnecessary ternaries

* fix: !($id <= 0);

* remove ternary
This commit is contained in:
Dennis Dudek
2022-04-14 09:02:10 +02:00
committed by GitHub
parent d90676a793
commit 25d9c52c58
44 changed files with 310 additions and 304 deletions

View File

@@ -14,6 +14,9 @@
* @package Formfields
*
*/
use Froxlor\Settings;
return array(
'admin_add' => array(
'title' => $lng['admin']['admin_add'],
@@ -37,7 +40,7 @@ return array(
'admin_password_suggestion' => array(
'next_to_prefix' => $lng['customer']['generated_pwd'].':',
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(),
'readonly' => true
)
@@ -55,8 +58,8 @@ return array(
'desc' => $lng['usersettings']['api_allowed']['description'],
'type' => 'checkbox',
'value' => '1',
'checked' => (\Froxlor\Settings::Get('api.enabled') == '1' ? true : false),
'visible' => (\Froxlor\Settings::Get('api.enabled') == '1' ? true : false)
'checked' => Settings::Get('api.enabled') == '1',
'visible' => Settings::Get('api.enabled') == '1'
)
)
),
@@ -183,7 +186,7 @@ return array(
'type' => 'textul',
'value' => 0,
'maxlength' => 9,
'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false),
'visible' => Settings::Get('system.mail_quota_enabled') == '1',
'mandatory' => true
),
'ftps' => array(

View File

@@ -33,18 +33,18 @@ return array(
'type' => 'checkbox',
'value' => '1',
'checked' => $result['deactivated'],
'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true)
'visible' => $result['adminid'] != $userinfo['userid']
),
'admin_password' => array(
'label' => $lng['login']['password'] . '&nbsp;(' . $lng['panel']['emptyfornochanges'] . ')',
'type' => 'password',
'autocomplete' => 'off',
'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true),
'visible' => $result['adminid'] != $userinfo['userid'],
'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)),
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == '' && !($result['adminid'] == $userinfo['userid'])),
'value' => \Froxlor\System\Crypt::generatePassword(),
'readonly' => true
)
@@ -55,7 +55,7 @@ return array(
'type' => 'select',
'select_var' => $languages,
'selected' => $result['def_language'],
'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true)
'visible' => $result['adminid'] != $userinfo['userid']
),
'api_allowed' => array(
'label' => $lng['usersettings']['api_allowed']['title'],
@@ -63,7 +63,7 @@ return array(
'type' => 'checkbox',
'value' => '1',
'checked' => $result['api_allowed'],
'visible' => (\Froxlor\Settings::Get('api.enabled') == '1' ? true : false)
'visible' => \Froxlor\Settings::Get('api.enabled') == '1'
)
)
),
@@ -102,7 +102,7 @@ return array(
'section_c' => array(
'title' => $lng['admin']['servicedata'],
'image' => 'icons/user_add.png',
'visible' => ($result['adminid'] != $userinfo['userid'] ? true : false),
'visible' => $result['adminid'] != $userinfo['userid'],
'fields' => array(
'ipaddress' => array(
'label' => $lng['serversettings']['ipaddress']['title'],
@@ -195,7 +195,7 @@ return array(
'type' => 'textul',
'value' => $result['email_quota'],
'maxlength' => 9,
'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false),
'visible' => \Froxlor\Settings::Get('system.mail_quota_enabled') == '1',
'mandatory' => true
),
'ftps' => array(