Commit dbf51859 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Feature #5347 / Error Message (Exception): BS colored box for report error messages.

parent 2d3134bc
......@@ -18,6 +18,7 @@ class QfqController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
public function showAction() {
$origErrorReporting = '';
$flagOk = false;
try {
$contentObject = $this->configurationManager->getContentObject();
......@@ -29,6 +30,7 @@ class QfqController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
$qfq = new \qfq\QuickFormQuery($contentObject->data);
$html = $qfq->process();
$flagOk = true;
} catch (qfq\UserFormException $e) {
$html = $e->formatMessage();
......@@ -52,6 +54,10 @@ class QfqController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
$html = "Generic Exception: " . $e->getMessage();
}
if (!$flagOk) {
$html = "<div class='alert alert-warning'>$html</div>";
}
// Restore has to be outside of try/catch - E_NOTICE needs to unset for further T3 handling after an QFQ Exception.
error_reporting($origErrorReporting);
......
......@@ -1330,3 +1330,5 @@ const EXCEPTION_MESSAGE = 'Message';
const EXCEPTION_FILE = 'File';
const EXCEPTION_LINE = 'Line';
const EXCEPTION_STACKTRACE = 'Stacktrace';
const EXCEPTION_TABLE_CLASS = 'table table-hover qfq-table-80';
\ No newline at end of file
......@@ -93,8 +93,8 @@ class AbstractException extends \Exception {
$arrDebugShow = OnArray::htmlentitiesOnArray($arrDebugShow);
$arrDebugHidden = OnArray::htmlentitiesOnArray($arrDebugHidden);
$htmlDebug = OnArray::arrayToHtmlTable($arrDebugShow, 'Debug', "table table-hover qfq-table-100");
$hidden = OnArray::arrayToHtmlTable($arrDebugHidden, 'Details', "table table-hover qfq-table-100");
$htmlDebug = OnArray::arrayToHtmlTable($arrDebugShow, 'Debug', EXCEPTION_TABLE_CLASS);
$hidden = OnArray::arrayToHtmlTable($arrDebugHidden, 'Details', EXCEPTION_TABLE_CLASS);
// $hidden = 'mein test<br>und mehr content';
// Show / hide with just CSS: http://jsfiddle.net/t5Nf8/1/
......@@ -104,11 +104,10 @@ class AbstractException extends \Exception {
// Sanitize any HTML content.
$arrShow = OnArray::htmlentitiesOnArray($arrShow);
$html = OnArray::arrayToHtmlTable($arrShow, 'Error', "table table-hover qfq-table-100");
$html = OnArray::arrayToHtmlTable($arrShow, 'Error', EXCEPTION_TABLE_CLASS);
// foreach ($show as $key => $value) {
// $html .= "$key: " . Support::wrapTag("<strong>", $value) . "<br>";
// }
$html = Support::wrapTag("<div class='warning'>", $html);
return $html . $htmlDebug;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment