Improved the ajax controller.

This commit is contained in:
2021-08-31 16:00:12 +02:00
parent 1651d4358c
commit 5651d3dca8
15 changed files with 307 additions and 153 deletions

View File

@ -4344,13 +4344,13 @@ class Interpretation extends Fields
. $default['on_field']
. " is an array with values.";
$methods .= PHP_EOL . $this->_t(2) . "\$array = ("
. $this->fileContentStatic[$this->hhh
. 'Component' . $this->hhh]
. "Helper::checkJson(\$"
. $default['on_field']
. ", true)) ? json_decode(\$"
. $default['on_field'] . ",true) : \$"
. $default['on_field'] . ";";
. $this->fileContentStatic[$this->hhh
. 'Component' . $this->hhh]
. "Helper::checkJson(\$"
. $default['on_field']
. ", true)) ? json_decode(\$"
. $default['on_field'] . ",true) : \$"
. $default['on_field'] . ";";
$methods .= PHP_EOL . $this->_t(2)
. "if (isset(\$array) && "
. $this->fileContentStatic[$this->hhh
@ -17900,8 +17900,6 @@ class Interpretation extends Fields
$cases .= PHP_EOL . $this->_t(4) . "case '" . $task . "':";
$cases .= PHP_EOL . $this->_t(5) . "try";
$cases .= PHP_EOL . $this->_t(5) . "{";
$cases .= PHP_EOL . $this->_t(6)
. "\$returnRaw = \$jinput->get('raw', false, 'BOOLEAN');";
foreach ($input[$task] as $string)
{
$cases .= PHP_EOL . $this->_t(6) . $string;
@ -17936,7 +17934,7 @@ class Interpretation extends Fields
}
// continue the build
$cases .= PHP_EOL . $this->_t(6)
. "if(\$callback = \$jinput->get('callback', null, 'CMD'))";
. "if(\$callback)";
$cases .= PHP_EOL . $this->_t(6) . "{";
$cases .= PHP_EOL . $this->_t(7)
. "echo \$callback . \"(\".json_encode(\$result).\");\";";
@ -17955,11 +17953,17 @@ class Interpretation extends Fields
$cases .= PHP_EOL . $this->_t(5) . "catch(Exception \$e)";
$cases .= PHP_EOL . $this->_t(5) . "{";
$cases .= PHP_EOL . $this->_t(6)
. "if(\$callback = \$jinput->get('callback', null, 'CMD'))";
. "if(\$callback)";
$cases .= PHP_EOL . $this->_t(6) . "{";
$cases .= PHP_EOL . $this->_t(7)
. "echo \$callback.\"(\".json_encode(\$e).\");\";";
$cases .= PHP_EOL . $this->_t(6) . "}";
$cases .= PHP_EOL . $this->_t(6)
. "elseif(\$returnRaw)";
$cases .= PHP_EOL . $this->_t(6) . "{";
$cases .= PHP_EOL . $this->_t(7)
. "echo json_encode(\$e);";
$cases .= PHP_EOL . $this->_t(6) . "}";
$cases .= PHP_EOL . $this->_t(6) . "else";
$cases .= PHP_EOL . $this->_t(6) . "{";
$cases .= PHP_EOL . $this->_t(7)