fix checked-property when applying hosting-plan for allowed-phpconfigs

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-02-12 14:58:17 +01:00
parent 4d7ceb9efe
commit de70dbb888
3 changed files with 8 additions and 8 deletions

View File

@@ -3912,4 +3912,3 @@ if (isDatabaseVersion('201801260')) {
updateToDbVersion('201802120'); updateToDbVersion('201802120');
} }

View File

@@ -302,9 +302,9 @@ return array(
'values' => $phpconfigs, 'values' => $phpconfigs,
'value' => ((int) Settings::Get('system.mod_fcgid') == 1 ? array( 'value' => ((int) Settings::Get('system.mod_fcgid') == 1 ? array(
Settings::Get('system.mod_fcgid_defaultini') Settings::Get('system.mod_fcgid_defaultini')
) : (int) Settings::Get('phpfpm.enabled') == 1) ? array( ) : (int) Settings::Get('phpfpm.enabled') == 1 ? array(
Settings::Get('phpfpm.defaultini') Settings::Get('phpfpm.defaultini')
) : array(), ) : array()),
'is_array' => 1 'is_array' => 1
), ),
'perlenabled' => array( 'perlenabled' => array(

View File

@@ -34,17 +34,18 @@ $(document).ready(function() {
if (i == 'email_imap' || i == 'email_pop3' || i == 'perlenabled' || i == 'phpenabled' || i == 'dnsenabled') { if (i == 'email_imap' || i == 'email_pop3' || i == 'perlenabled' || i == 'phpenabled' || i == 'dnsenabled') {
/** handle checkboxes **/ /** handle checkboxes **/
if (json[i] == 1) { if (json[i] == 1) {
$("input[name='"+i+"']").attr('checked', 'checked'); $("input[name='"+i+"']").prop('checked', true);
} else { } else {
$("input[name='"+i+"']").removeAttr('checked'); $("input[name='"+i+"']").prop('checked', false);
} }
} else if (i == 'allowed_phpconfigs') { } else if (i == 'allowed_phpconfigs') {
/** handle array of values **/ /** handle array of values **/
$("input[name='allowed_phpconfigs[]']").each(function(index) { $("input[name='allowed_phpconfigs[]']").each(function(index) {
$(this).removeAttr('checked'); $(this).prop('checked', false);
for (j in json[i]) { for (j in json[i]) {
if ($(this).val() == json[i][j]) { if ($(this).val() == json[i][j]) {
$(this).attr('checked', 'checked'); $(this).prop('checked', true);
break;
} }
} }
}); });
@@ -60,7 +61,7 @@ $(document).ready(function() {
$("input[name='"+i+"']").prop({ $("input[name='"+i+"']").prop({
readonly: false readonly: false
}); });
$("input[name='" + i + "_ul']").removeAttr('checked'); $("input[name='" + i + "_ul']").prop('checked', false);
} }
} }
}, },