From 27514d32de397f90cf9122f84be4abae96f343d7 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Mon, 2 Mar 2015 13:40:38 +0100 Subject: [PATCH] visible-tag needs to respect the do_show-value in case websrv_avail set do_show to false already Signed-off-by: Michael Kaufmann (d00p) --- lib/functions/formfields/function.buildFormEx.php | 5 +++-- lib/functions/formfields/function.getFormFieldOutput.php | 5 +++-- lib/functions/formfields/function.getFormGroupOutput.php | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/functions/formfields/function.buildFormEx.php b/lib/functions/formfields/function.buildFormEx.php index e6633d9e..69162471 100644 --- a/lib/functions/formfields/function.buildFormEx.php +++ b/lib/functions/formfields/function.buildFormEx.php @@ -43,8 +43,9 @@ function buildFormEx($form, $part = '') { } // visible = Settings::Get('phpfpm.enabled') for example would result in false if not enabled - // and therefore not shown as intended - if (isset($groupdetails['visible'])) { + // and therefore not shown as intended. Only check if do_show is still true as it might + // be false due to websrv_avail + if (isset($groupdetails['visible']) && $do_show) { $do_show = $groupdetails['visible']; } diff --git a/lib/functions/formfields/function.getFormFieldOutput.php b/lib/functions/formfields/function.getFormFieldOutput.php index 5529fe0e..e610ee8f 100644 --- a/lib/functions/formfields/function.getFormFieldOutput.php +++ b/lib/functions/formfields/function.getFormFieldOutput.php @@ -55,8 +55,9 @@ function getFormFieldOutput($fieldname, $fielddata) { } // visible = Settings::Get('phpfpm.enabled') for example would result in false if not enabled - // and therefore not shown as intended - if (isset($fielddata['visible'])) { + // and therefore not shown as intended. Only check if do_show is still true as it might + // be false due to websrv_avail + if (isset($fielddata['visible']) && $do_show) { $do_show = $fielddata['visible']; } diff --git a/lib/functions/formfields/function.getFormGroupOutput.php b/lib/functions/formfields/function.getFormGroupOutput.php index 038ff8e6..46bbe4fa 100644 --- a/lib/functions/formfields/function.getFormGroupOutput.php +++ b/lib/functions/formfields/function.getFormGroupOutput.php @@ -49,7 +49,7 @@ function getFormOverviewGroupOutput($groupname, $groupdetails) { if($fielddetails['type'] == 'option') { - $options_array = $fielddetails['option_options']; + $options_array = $fielddetails['option_options']; $options = ''; foreach($options_array as $value => $vtitle) { @@ -82,7 +82,7 @@ function getFormOverviewGroupOutput($groupname, $groupdetails) { if (!in_array($websrv, $groupdetails['websrv_avail'])) { $do_show = false; } - } + } if ($do_show) { eval("\$group = \"" . getTemplate("settings/settings_overviewgroup") . "\";");