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

Merge branch 'qfqFluidTemplate'

parents e5f5b75d eea6b786
Pipeline #1481 passed with stage
in 2 minutes and 22 seconds
......@@ -27,7 +27,9 @@ class QfqController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
public function showAction() {
$origErrorReporting = '';
$flagOk = false;
$hasError = true;
$error = '';
$hasContent = false;
try {
$contentObject = $this->configurationManager->getContentObject();
......@@ -39,38 +41,38 @@ class QfqController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
$qfq = new \qfq\QuickFormQuery($contentObject->data);
$html = $qfq->process();
$flagOk = true;
$hasContent = (strlen(trim($html))<=0);
$hasError = false;
} catch (qfq\UserFormException $e) {
$html = $e->formatMessage();
$error = $e->formatMessage();
} catch (qfq\UserReportException $e) {
$html = $e->formatMessage();
$error = $e->formatMessage();
} catch (qfq\CodeException $e) {
$html = $e->formatMessage();
$error = $e->formatMessage();
} catch (qfq\DbException $e) {
$html = $e->formatMessage();
$error = $e->formatMessage();
} catch (qfq\ShellException $e) {
$html = $e->formatMessage();
$error = $e->formatMessage();
} catch (qfq\DownloadException $e) {
$html = $e->formatMessage();
$error = $e->formatMessage();
} catch (\Exception $e) {
$html = "Generic Exception: " . $e->getMessage();
}
if (!$flagOk) {
$html = "<div class='alert alert-warning'>$html</div>";
$error = "Generic Exception: " . $e->getMessage();
}
// Restore has to be outside of try/catch - E_NOTICE needs to unset for further T3 handling after an QFQ Exception.
error_reporting($origErrorReporting);
$this->view->assign('qfqOutput', $html);
$this->view->assign('qfqError', $error);
$this->view->assign('qfqHasError', $hasError);
$this->view->assign('qfqHasContent', $hasContent);
return $this->view->render();
}
......
<f:layout name="Default" />
<f:comment>Currently not used.</f:comment>
<div class="qfq-default-layout">
<f:format.raw value="{qfqOutput}"/>
</div>
<f:layout name="Layout 1">
<div class="qfq-layout-1">
<f:format.raw value="{qfqOutput}"/>
</div>
</f:layout>
\ No newline at end of file
<f:layout name="Layout 2">
<div class="qfq-layout-2">
<f:format.raw value="{qfqOutput}"/>
</div>
</f:layout>
\ No newline at end of file
<f:layout name="Layout 3" />
<f:comment>Unwrapped raw output.</f:comment>
<f:format.raw value="{qfqOutput}"/>
<f:format.raw value="{qfqOutput}"/>
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:if condition="{qfqHasContent}">
<div class="qfq-default-layout">
<f:format.raw value="{qfqOutput}"/>
</div>
</f:if>
<f:if condition="{qfqHasError}">
<div class="alert alert-warning">
<f:format.raw value="{qfqError}"/>
</div>
</f:if>
\ No newline at end of file
Supports Markdown
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