From 37a242a6791f2467bcbca26bb79a0f30e042e518 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Mon, 16 Dec 2013 11:03:09 +0100 Subject: [PATCH] migrate webftp stuff to new settings-class, refs #1325 Signed-off-by: Michael Kaufmann (d00p) --- .../function.getFormFieldOutput.php | 45 ++++++++----------- templates/Froxlor/index.tpl | 10 ++--- templates/Sparkle/index.tpl | 10 ++--- webftp.php | 10 +++-- 4 files changed, 35 insertions(+), 40 deletions(-) diff --git a/lib/functions/formfields/function.getFormFieldOutput.php b/lib/functions/formfields/function.getFormFieldOutput.php index b6ac4f22..8d4a6d06 100644 --- a/lib/functions/formfields/function.getFormFieldOutput.php +++ b/lib/functions/formfields/function.getFormFieldOutput.php @@ -17,53 +17,44 @@ * */ -function getFormFieldOutput($fieldname, $fielddata) -{ - global $settings, $theme; +function getFormFieldOutput($fieldname, $fielddata) { $returnvalue = ''; - if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldOutput' . ucfirst($fielddata['type']))) - { - if(isset($fielddata['label']) && is_array($fielddata['label'])) - { - if(isset($fielddata['label']['title']) && isset($fielddata['label']['description'])) - { + if (is_array($fielddata) + && isset($fielddata['type']) + && $fielddata['type'] != '' + && function_exists('getFormFieldOutput' . ucfirst($fielddata['type'])) + ) { + if (isset($fielddata['label']) && is_array($fielddata['label'])) { + if (isset($fielddata['label']['title']) && isset($fielddata['label']['description'])) { $fielddata['label'] = '' . $fielddata['label']['title'] . '
' . $fielddata['label']['description']; - } - else - { + } else { $fielddata['label'] = implode(' ', $fielddata['label']); } } - if(!isset($fielddata['value'])) - { - if(isset($fielddata['default'])) - { + + if (!isset($fielddata['value'])) { + if (isset($fielddata['default'])) { $fielddata['value'] = $fielddata['default']; - } - else - { + } else { $fielddata['value'] = null; } } - + /** * this part checks for the 'websrv_avail' entry in the settings-array * if found, we check if the current webserver is in the array. If this * is not the case, we change the setting type to "hidden", #502 */ $do_show = true; - if(isset($fielddata['websrv_avail']) && is_array($fielddata['websrv_avail'])) - { - $websrv = $settings['system']['webserver']; - if(!in_array($websrv, $fielddata['websrv_avail'])) - { + if (isset($fielddata['websrv_avail']) && is_array($fielddata['websrv_avail'])) { + $websrv = Settings::Get('system.webserver'); + if (!in_array($websrv, $fielddata['websrv_avail'])) { $do_show = false; } } - if($do_show) - { + if ($do_show) { $returnvalue = call_user_func('getFormFieldOutput' . ucfirst($fielddata['type']), $fieldname, $fielddata); } } diff --git a/templates/Froxlor/index.tpl b/templates/Froxlor/index.tpl index 18a81088..a20bd894 100644 --- a/templates/Froxlor/index.tpl +++ b/templates/Froxlor/index.tpl @@ -3,12 +3,12 @@ - {if $settings.panel.no_robots == 0} + {if $no_robots == 0} {/if} - {if $settings.panel.use_webfonts == 1} - + {if $use_webfonts == 1} + {/if} @@ -19,7 +19,7 @@ {$title}Froxlor Server Management Panel @@ -45,7 +45,7 @@