refactor global array

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-21 20:51:44 +01:00
parent c5a58e3f36
commit 370ccbdb74
220 changed files with 2227 additions and 2244 deletions

View File

@@ -18,8 +18,6 @@
*/
function getFormFieldOutput($fieldname, $fielddata)
{
global $lng;
$returnvalue = '';
if (is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldOutput' . ucfirst($fielddata['type']))) {
if (isset($fielddata['label']) && is_array($fielddata['label'])) {
@@ -49,7 +47,7 @@ function getFormFieldOutput($fieldname, $fielddata)
$websrv = Settings::Get('system.webserver');
if (! in_array($websrv, $fielddata['websrv_avail'])) {
$do_show = false;
$fielddata['label'] .= sprintf($lng['serversettings']['option_unavailable_websrv'], implode(", ", $fielddata['websrv_avail']));
$fielddata['label'] .= sprintf(\Froxlor\I18N\Lang::getAll()['serversettings']['option_unavailable_websrv'], implode(", ", $fielddata['websrv_avail']));
}
}
@@ -59,7 +57,7 @@ function getFormFieldOutput($fieldname, $fielddata)
if (isset($fielddata['visible']) && $do_show) {
$do_show = $fielddata['visible'];
if (! $do_show) {
$fielddata['label'] .= $lng['serversettings']['option_unavailable'];
$fielddata['label'] .= \Froxlor\I18N\Lang::getAll()['serversettings']['option_unavailable'];
}
}

View File

@@ -18,14 +18,14 @@
*/
function getFormGroupOutput($groupname, $groupdetails)
{
global $lng, $theme;
global $theme;
eval("\$group = \"" . \Froxlor\UI\Template::getTemplate("settings/settings_group") . "\";");
return $group;
}
function getFormOverviewGroupOutput($groupname, $groupdetails)
{
global $lng, $filename, $s, $theme;
global $filename, $s, $theme;
$group = '';
$title = $groupdetails['title'];
@@ -52,7 +52,7 @@ function getFormOverviewGroupOutput($groupname, $groupdetails)
$option .= '</select>';
$activated = true;
} else {
$option .= $lng['admin']['activated'] . ':&nbsp;';
$option .= \Froxlor\I18N\Lang::getAll()['admin']['activated'] . ':&nbsp;';
$option .= \Froxlor\UI\HTML::makeyesno($fieldname, '1', '0', Settings::Get($fielddetails['settinggroup'] . '.' . $fielddetails['varname']));
$activated = (int) Settings::Get($fielddetails['settinggroup'] . '.' . $fielddetails['varname']);
}
@@ -71,7 +71,7 @@ function getFormOverviewGroupOutput($groupname, $groupdetails)
$websrv = Settings::Get('system.webserver');
if (! in_array($websrv, $groupdetails['websrv_avail'])) {
$do_show = false;
$title .= sprintf($lng['serversettings']['option_unavailable_websrv'], implode(", ", $groupdetails['websrv_avail']));
$title .= sprintf(\Froxlor\I18N\Lang::getAll()['serversettings']['option_unavailable_websrv'], implode(", ", $groupdetails['websrv_avail']));
// hack disabled flag into select-box
$option = str_replace('<select class', '<select disabled="disabled" class', $option);
}