Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
44205040
Commit
44205040
authored
Feb 04, 2019
by
bbaer
Browse files
Updated fluid rendering for qfq.
parent
78a8a4b2
Pipeline
#1479
passed with stage
in 2 minutes and 16 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/Classes/Controller/QfqController.php
View file @
44205040
...
...
@@ -27,7 +27,9 @@ class QfqController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
public
function
showAction
()
{
$origErrorReporting
=
''
;
$flagOk
=
false
;
$flagNOk
=
true
;
$exception
=
''
;
$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
);
$flagNOk
=
false
;
}
catch
(
qfq\UserFormException
$e
)
{
$
html
=
$e
->
formatMessage
();
$
exception
=
$e
->
formatMessage
();
}
catch
(
qfq\UserReportException
$e
)
{
$
html
=
$e
->
formatMessage
();
$
exception
=
$e
->
formatMessage
();
}
catch
(
qfq\CodeException
$e
)
{
$
html
=
$e
->
formatMessage
();
$
exception
=
$e
->
formatMessage
();
}
catch
(
qfq\DbException
$e
)
{
$
html
=
$e
->
formatMessage
();
$
exception
=
$e
->
formatMessage
();
}
catch
(
qfq\ShellException
$e
)
{
$
html
=
$e
->
formatMessage
();
$
exception
=
$e
->
formatMessage
();
}
catch
(
qfq\DownloadException
$e
)
{
$
html
=
$e
->
formatMessage
();
$
exception
=
$e
->
formatMessage
();
}
catch
(
\
Exception
$e
)
{
$html
=
"Generic Exception: "
.
$e
->
getMessage
();
}
if
(
!
$flagOk
)
{
$html
=
"<div class='alert alert-warning'>
$html
</div>"
;
$exception
=
"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
(
'qfqNotOkay'
,
$flagNOk
);
$this
->
view
->
assign
(
'qfqHasContent'
,
$hasContent
);
$this
->
view
->
assign
(
'qfqException'
,
$exception
);
return
$this
->
view
->
render
();
}
...
...
extension/Resources/Private/Layouts/Default.html
0 → 100644
View file @
44205040
<f:layout
name=
"Default"
/>
<f:comment>
Currently not used.
</f:comment>
<div
class=
"qfq-default-layout"
>
<f:format.raw
value=
"{qfqOutput}"
/>
</div>
extension/Resources/Private/Layouts/Layout1.html
0 → 100644
View file @
44205040
<f:layout
name=
"Layout 1"
>
<div
class=
"qfq-layout-1"
>
<f:format.raw
value=
"{qfqOutput}"
/>
</div>
</f:layout>
\ No newline at end of file
extension/Resources/Private/Layouts/Layout2.html
0 → 100644
View file @
44205040
<f:layout
name=
"Layout 2"
>
<div
class=
"qfq-layout-2"
>
<f:format.raw
value=
"{qfqOutput}"
/>
</div>
</f:layout>
\ No newline at end of file
extension/Resources/Private/Layouts/Layout3.html
0 → 100644
View file @
44205040
<f:layout
name=
"Layout 3"
/>
<f:comment>
Unwrapped raw output.
</f:comment>
<f:format.raw
value=
"{qfqOutput}"
/>
extension/Resources/Private/Templates/Qfq/Show.html
View file @
44205040
<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=
"{qfqNotOkay}"
>
<div
class=
"warning warning-danger"
>
<f:format.raw
value=
"{qfqException}"
/>
</div>
</f:if>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment