refactor UI functions
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -21,6 +21,6 @@ function getFormFieldOutputBool($fieldname, $fielddata, $do_show = true)
|
||||
{
|
||||
$label = $fielddata['label'];
|
||||
$boolswitch = makeYesNo($fieldname, '1', '0', $fielddata['value']);
|
||||
eval("\$returnvalue = \"" . getTemplate("formfields/bool", true) . "\";");
|
||||
eval("\$returnvalue = \"" . \Froxlor\UI\Template::getTemplate("formfields/bool", true) . "\";");
|
||||
return $returnvalue;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,6 @@ function getFormFieldOutputFile($fieldname, $fielddata, $do_show = true)
|
||||
{
|
||||
$label = $fielddata['label'];
|
||||
$value = htmlentities($fielddata['value']);
|
||||
eval("\$returnvalue = \"" . getTemplate("formfields/text", true) . "\";");
|
||||
eval("\$returnvalue = \"" . \Froxlor\UI\Template::getTemplate("formfields/text", true) . "\";");
|
||||
return $returnvalue;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
function getFormGroupOutput($groupname, $groupdetails) {
|
||||
|
||||
global $lng, $theme;
|
||||
eval("\$group = \"" . getTemplate("settings/settings_group") . "\";");
|
||||
eval("\$group = \"" . \Froxlor\UI\Template::getTemplate("settings/settings_group") . "\";");
|
||||
return $group;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ function getFormOverviewGroupOutput($groupname, $groupdetails) {
|
||||
if($fielddetails['type'] != 'option'
|
||||
&& $fielddetails['type'] != 'bool')
|
||||
{
|
||||
standard_error('overviewsettingoptionisnotavalidfield');
|
||||
\Froxlor\UI\Response::standard_error('overviewsettingoptionisnotavalidfield');
|
||||
}
|
||||
|
||||
if($fielddetails['type'] == 'option')
|
||||
@@ -87,7 +87,7 @@ function getFormOverviewGroupOutput($groupname, $groupdetails) {
|
||||
}
|
||||
}
|
||||
|
||||
eval("\$group = \"" . getTemplate("settings/settings_overviewgroup") . "\";");
|
||||
eval("\$group = \"" . \Froxlor\UI\Template::getTemplate("settings/settings_overviewgroup") . "\";");
|
||||
|
||||
return $group;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ function processForm(&$form, &$input, $url_params = array())
|
||||
{
|
||||
if(($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true)
|
||||
{
|
||||
standard_error($error, $fieldname);
|
||||
\Froxlor\UI\Response::standard_error($error, $fieldname);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -85,7 +85,7 @@ function processForm(&$form, &$input, $url_params = array())
|
||||
$error = $plausibility_check[1];
|
||||
unset($plausibility_check[1]);
|
||||
$targetname = implode(' ', $plausibility_check);
|
||||
standard_error($error, $targetname);
|
||||
\Froxlor\UI\Response::standard_error($error, $targetname);
|
||||
}
|
||||
elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION)
|
||||
{
|
||||
@@ -109,7 +109,7 @@ function processForm(&$form, &$input, $url_params = array())
|
||||
}
|
||||
else
|
||||
{
|
||||
standard_error('plausibilitychecknotunderstood');
|
||||
\Froxlor\UI\Response::standard_error('plausibilitychecknotunderstood');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ function processForm(&$form, &$input, $url_params = array())
|
||||
}
|
||||
else
|
||||
{
|
||||
standard_error('errorwhensaving', $fieldname);
|
||||
\Froxlor\UI\Response::standard_error('errorwhensaving', $fieldname);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -193,7 +193,7 @@ function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_
|
||||
{
|
||||
if(($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true)
|
||||
{
|
||||
standard_error($error, $fieldname);
|
||||
\Froxlor\UI\Response::standard_error($error, $fieldname);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -236,7 +236,7 @@ function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_
|
||||
$error = $plausibility_check[1];
|
||||
unset($plausibility_check[1]);
|
||||
$targetname = implode(' ', $plausibility_check);
|
||||
standard_error($error, $targetname);
|
||||
\Froxlor\UI\Response::standard_error($error, $targetname);
|
||||
}
|
||||
elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION)
|
||||
{
|
||||
@@ -260,7 +260,7 @@ function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_
|
||||
}
|
||||
else
|
||||
{
|
||||
standard_error('plausibilitychecknotunderstood');
|
||||
\Froxlor\UI\Response::standard_error('plausibilitychecknotunderstood');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -292,7 +292,7 @@ function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_
|
||||
}
|
||||
else
|
||||
{
|
||||
standard_error('errorwhensaving', $fieldname);
|
||||
\Froxlor\UI\Response::standard_error('errorwhensaving', $fieldname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ function getFormFieldOutputHidden($fieldname, $fielddata)
|
||||
{
|
||||
$label = $fielddata['label'];
|
||||
$value = htmlentities($fielddata['value']);
|
||||
eval("\$returnvalue .= \"" . getTemplate("formfields/hidden", true) . "\";");
|
||||
eval("\$returnvalue .= \"" . \Froxlor\UI\Template::getTemplate("formfields/hidden", true) . "\";");
|
||||
}
|
||||
|
||||
return $returnvalue;
|
||||
|
||||
@@ -21,6 +21,6 @@ function getFormFieldOutputHiddenString($fieldname, $fielddata, $do_show = true)
|
||||
{
|
||||
$label = $fielddata['label'];
|
||||
$value = htmlentities($fielddata['value']);
|
||||
eval("\$returnvalue = \"" . getTemplate("formfields/hiddenstring", true) . "\";");
|
||||
eval("\$returnvalue = \"" . \Froxlor\UI\Template::getTemplate("formfields/hiddenstring", true) . "\";");
|
||||
return $returnvalue;
|
||||
}
|
||||
@@ -20,6 +20,6 @@
|
||||
function getFormFieldOutputLabel($fieldname, $fielddata)
|
||||
{
|
||||
$label = $fielddata['label'];
|
||||
eval("\$returnvalue = \"" . getTemplate("formfields/label", true) . "\";");
|
||||
eval("\$returnvalue = \"" . \Froxlor\UI\Template::getTemplate("formfields/label", true) . "\";");
|
||||
return $returnvalue;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ function getFormFieldOutputOption($fieldname, $fielddata, $do_show = true)
|
||||
{
|
||||
$options .= makeoption($title, $value, $fielddata['value']);
|
||||
}
|
||||
eval("\$returnvalue = \"" . getTemplate("formfields/option", true) . "\";");
|
||||
eval("\$returnvalue = \"" . \Froxlor\UI\Template::getTemplate("formfields/option", true) . "\";");
|
||||
}
|
||||
|
||||
return $returnvalue;
|
||||
|
||||
@@ -21,6 +21,6 @@ function getFormFieldOutputString($fieldname, $fielddata, $do_show = true)
|
||||
{
|
||||
$label = $fielddata['label'];
|
||||
$value = htmlentities($fielddata['value']);
|
||||
eval("\$returnvalue = \"" . getTemplate("formfields/string", true) . "\";");
|
||||
eval("\$returnvalue = \"" . \Froxlor\UI\Template::getTemplate("formfields/string", true) . "\";");
|
||||
return $returnvalue;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,6 @@ function getFormFieldOutputText($fieldname, $fielddata, $do_show = true)
|
||||
{
|
||||
$label = $fielddata['label'];
|
||||
$value = htmlentities($fielddata['value']);
|
||||
eval("\$returnvalue = \"" . getTemplate("formfields/text", true) . "\";");
|
||||
eval("\$returnvalue = \"" . \Froxlor\UI\Template::getTemplate("formfields/text", true) . "\";");
|
||||
return $returnvalue;
|
||||
}
|
||||
|
||||
@@ -47,14 +47,14 @@ function correctErrorDocument($errdoc = null, $throw_exception = false) {
|
||||
else {
|
||||
// string won't work for lighty
|
||||
if (Settings::Get('system.webserver') == 'lighttpd') {
|
||||
standard_error('stringerrordocumentnotvalidforlighty', '', $throw_exception);
|
||||
\Froxlor\UI\Response::standard_error('stringerrordocumentnotvalidforlighty', '', $throw_exception);
|
||||
} elseif(substr($errdoc, -1) != '"') {
|
||||
$errdoc .= '"';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (Settings::Get('system.webserver') == 'lighttpd') {
|
||||
standard_error('urlerrordocumentnotvalidforlighty', '', $throw_exception);
|
||||
\Froxlor\UI\Response::standard_error('urlerrordocumentnotvalidforlighty', '', $throw_exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ function buildNavigation($navigation, $userinfo) {
|
||||
$navlabel = $element['label'];
|
||||
}
|
||||
|
||||
eval("\$navigation_links .= \"" . getTemplate("navigation_link", 1) . "\";");
|
||||
eval("\$navigation_links .= \"" . \Froxlor\UI\Template::getTemplate("navigation_link", 1) . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ function buildNavigation($navigation, $userinfo) {
|
||||
$navlabel = $box['label'];
|
||||
}
|
||||
|
||||
eval("\$returnvalue .= \"" . getTemplate("navigation_element", 1) . "\";");
|
||||
eval("\$returnvalue .= \"" . \Froxlor\UI\Template::getTemplate("navigation_element", 1) . "\";");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user