Skip to content
GitLab
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
2968dc8e
Commit
2968dc8e
authored
Aug 06, 2018
by
Elias Villiger
Browse files
Feature #6255 - Draft scaffold for inline report editing
parent
fef1a122
Pipeline
#709
passed with stage
in 1 minute and 44 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/qfq/qfq/Constants.php
View file @
2968dc8e
...
...
@@ -1184,6 +1184,7 @@ const INDEX_PHP = 'index.php';
// QuickFormQuery.php
const
T3DATA_BODYTEXT
=
'bodytext'
;
const
T3DATA_BODYTEXT_RAW
=
'bodytext-raw'
;
const
T3DATA_UID
=
'uid'
;
// Special Column to check for uploads
...
...
extension/qfq/qfq/QuickFormQuery.php
View file @
2968dc8e
...
...
@@ -151,6 +151,7 @@ class QuickFormQuery {
}
$btp
=
new
BodytextParser
();
$t3data
[
T3DATA_BODYTEXT_RAW
]
=
$t3data
[
T3DATA_BODYTEXT
];
$t3data
[
T3DATA_BODYTEXT
]
=
$btp
->
process
(
$t3data
[
T3DATA_BODYTEXT
]);
$this
->
t3data
=
$t3data
;
...
...
@@ -1328,12 +1329,44 @@ class QuickFormQuery {
private
function
doReport
()
{
$report
=
new
Report
(
$this
->
t3data
,
$this
->
eval
,
$this
->
phpUnit
);
$html
=
''
;
$html
=
$report
->
process
(
$this
->
t3data
[
'bodytext'
]);
if
(
$this
->
store
->
getVar
(
TYPO3_BE_USER
,
STORE_TYPO3
,
SANITIZE_ALLOW_ALNUMX
))
{
$html
.
=
$this
->
doInlineReport
();
}
$html
.
=
$report
->
process
(
$this
->
t3data
[
T3DATA_BODYTEXT
]);
return
$html
;
}
/** Constructs a form to directly edit qfq content elements inline.
*
* @return string - the html code
* @throws CodeException
* @throws UserFormException
*/
private
function
doInlineReport
()
{
$uid
=
$this
->
t3data
[
T3DATA_UID
];
$icon
=
Support
::
wrapTag
(
'<span class="'
.
GLYPH_ICON
.
' '
.
GLYPH_ICON_TASKS
.
'">'
,
''
);
$showEditBoxJs
=
'$("#tt-content-edit-'
.
$uid
.
'").toggleClass("hidden")'
;
$editBtn
=
Support
::
wrapTag
(
"<a href='#' onclick='
$showEditBoxJs
' style='float:right;'>"
,
$icon
);
$saveBtnAttributes
=
Support
::
doAttribute
(
'class'
,
'btn btn-default btn-block'
);
$saveBtnAttributes
.
=
Support
::
doAttribute
(
'id'
,
"tt-content-save-
$uid
"
);
$saveBtn
=
Support
::
wrapTag
(
"<button
$saveBtnAttributes
>"
,
'Save'
);
$ttContentCode
=
Support
::
htmlEntityEncodeDecode
(
MODE_ENCODE
,
$this
->
t3data
[
T3DATA_BODYTEXT_RAW
]);
$codeBoxAttributes
=
Support
::
doAttribute
(
'style'
,
"width:100%; height:200px;"
);
$codeBoxAttributes
.
=
Support
::
doAttribute
(
'id'
,
"tt-content-code-
$uid
"
);
$codeBox
=
Support
::
wrapTag
(
"<textarea
$codeBoxAttributes
>"
,
$ttContentCode
);
$editBox
=
join
(
' '
,
[
$saveBtn
,
$codeBox
]);
$editBox
=
Support
::
wrapTag
(
"<div id='tt-content-edit-
$uid
' class='hidden'>"
,
$editBox
);
return
$editBtn
.
$editBox
;
}
/**
* Save the current form.
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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