Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qfq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
typo3
qfq
Commits
3c01a572
Commit
3c01a572
authored
2 years ago
by
Carsten Rose
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
1071b0aa
cdbce4ee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!430
Merge new version 22.05
Pipeline
#7075
passed
2 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
extension/Classes/Core/QuickFormQuery.php
+11
-5
11 additions, 5 deletions
extension/Classes/Core/QuickFormQuery.php
javascript/src/Helper/codemirror.js
+3
-17
3 additions, 17 deletions
javascript/src/Helper/codemirror.js
with
14 additions
and
22 deletions
extension/Classes/Core/QuickFormQuery.php
+
11
−
5
View file @
3c01a572
...
...
@@ -1670,9 +1670,10 @@ class QuickFormQuery {
$html
=
''
;
$beUserLoggedIn
=
$this
->
store
->
getVar
(
TYPO3_BE_USER
,
STORE_TYPO3
,
SANITIZE_ALLOW_ALNUMX
);
$pageTitle
=
$this
->
store
->
getVar
(
TYPO3_PAGE_TITLE
,
STORE_TYPO3
,
SANITIZE_ALLOW_ALNUMX
);
if
(
$beUserLoggedIn
&&
$this
->
inlineReport
)
{
$html
.
=
$this
->
buildInlineReport
(
$this
->
t3data
[
T3DATA_UID
]
??
null
,
$this
->
t3data
[
T3DATA_REPORT_PATH_FILENAME
]
??
null
,
$this
->
t3data
[
T3DATA_BODYTEXT_RAW
]
??
''
,
$this
->
t3data
[
T3DATA_HEADER
]
??
''
);
$this
->
t3data
[
T3DATA_BODYTEXT_RAW
]
??
''
,
$this
->
t3data
[
T3DATA_HEADER
]
??
''
,
$pageTitle
??
''
);
}
$html
.
=
$report
->
process
(
$this
->
t3data
[
T3DATA_BODYTEXT
]);
...
...
@@ -1690,7 +1691,7 @@ class QuickFormQuery {
* @throws \CodeException
* @throws \UserFormException
*/
public
static
function
buildInlineReport
(
?int
$uid
,
?string
$reportPathFileNameFull
,
string
$bodytext
,
string
$header
):
string
{
public
static
function
buildInlineReport
(
?int
$uid
,
?string
$reportPathFileNameFull
,
string
$bodytext
,
string
$header
,
string
$pageTitle
=
''
):
string
{
if
(
$uid
===
null
)
{
return
''
;
}
...
...
@@ -1698,6 +1699,12 @@ class QuickFormQuery {
$showFormJs
=
'$("#tt-content-edit-'
.
$uid
.
'").toggleClass("hidden")'
;
$toggleBtn
=
Support
::
wrapTag
(
"<a href='#' class='targetEditReport btn-xs btn-info' onclick='
$showFormJs
' style='float:right;'>"
,
$icon
);
if
(
$reportPathFileNameFull
!==
''
&&
$reportPathFileNameFull
!==
null
){
$reportPathFileNameFullHtml
=
"<small>File: '
$reportPathFileNameFull
'</small>"
;
}
else
{
$reportPathFileNameFullHtml
=
' '
;
}
$saveBtnAttributes
=
Support
::
doAttribute
(
'class'
,
'btn btn-default'
)
.
Support
::
doAttribute
(
'id'
,
"tt-content-save-
$uid
"
)
.
Support
::
doAttribute
(
'type'
,
'submit'
)
.
...
...
@@ -1705,8 +1712,8 @@ class QuickFormQuery {
Support
::
doAttribute
(
'title'
,
'Save & Reload'
);
$saveBtnIcon
=
Support
::
renderGlyphIcon
(
GLYPH_ICON_CHECK
);
$saveBtn
=
Support
::
wrapTag
(
"<button
$saveBtnAttributes
>"
,
$saveBtnIcon
);
$header
=
"
QFQ
Page Content '
$header
'.<br><small>File: '
$reportPathFileNameFull
'</small>
"
;
$headerBar
=
Support
::
wrapTag
(
"<div class='col-md-12 qfq-form-title'>"
,
$header
.
$saveBtn
);
$header
=
"Page
: '
$pageTitle
'
Content
(ID):
'
$header
(
$uid
)'<br>
$reportPathFileNameFull
Html
"
;
$headerBar
=
Support
::
wrapTag
(
"<div class='col-md-12 qfq-form-title'
style='position: sticky;top: 0;z-index: 1000;'
>"
,
$header
.
$saveBtn
);
$ttContentCode
=
Support
::
htmlEntityEncodeDecode
(
MODE_ENCODE
,
$bodytext
);
...
...
@@ -1715,7 +1722,6 @@ class QuickFormQuery {
Support
::
doAttribute
(
'id'
,
"tt-content-code-
$uid
"
)
.
Support
::
doAttribute
(
'name'
,
REPORT_INLINE_BODYTEXT
)
.
Support
::
doAttribute
(
'class'
,
'qfq-codemirror'
)
.
Support
::
doAttribute
(
'rows'
,
20
)
.
Support
::
doAttribute
(
'data-config'
,
$json
,
true
);
$codeBox
=
Support
::
wrapTag
(
"<textarea
$codeBoxAttributes
>"
,
$ttContentCode
);
...
...
This diff is collapsed.
Click to expand it.
javascript/src/Helper/codemirror.js
+
3
−
17
View file @
3c01a572
...
...
@@ -99,7 +99,7 @@ $(document).ready(function(){
// function to create new window with given content for editing
function
newWindow
(
windowName
)
{
var
w
=
window
.
open
(
'
'
,
windowName
,
'
width=900,height=700
'
);
var
w
=
window
.
open
(
'
//
'
+
location
.
host
+
location
.
pathname
+
'
?tt-content=
'
+
windowName
,
windowName
,
'
width=900,height=700
'
);
w
.
document
.
write
(
htmlContent
);
w
.
document
.
close
();
}
...
...
@@ -107,12 +107,6 @@ $(document).ready(function(){
// Show same content editor with refreshed data again after save. Control it with the given get parameter. First fetch only needed html content again (form) and open it in same window.
var
urlParams
=
new
URLSearchParams
(
window
.
location
.
search
);
var
ttContentParam
=
urlParams
.
get
(
'
tt-content
'
);
var
pageId
=
urlParams
.
get
(
'
id
'
);
if
(
pageId
===
null
){
pageId
=
''
;
}
else
{
pageId
=
'
id=
'
+
pageId
+
'
&
'
;
}
if
(
ttContentParam
!==
null
&&
$
(
targetEditReportButton
).
next
(
"
#
"
+
ttContentParam
)[
0
]
!==
undefined
){
var
formContent
=
$
(
$
(
targetEditReportButton
).
next
(
"
#
"
+
ttContentParam
)[
0
].
outerHTML
);
...
...
@@ -122,23 +116,15 @@ $(document).ready(function(){
// execute changes(post) and reload page with id of tt-content as get parameter. Staying in same window with new content.
$
(
externWindow
).
submit
(
function
()
{
$
.
post
(
$
(
externWindow
).
attr
(
'
action
'
),
$
(
externWindow
).
serializeArray
());
$
(
'
<
div
style="
text-align: right; margin-top: 10px;"><span style="
background-color: green;" class="badge badge-success">Saved</span>
</div>
'
)
.
insert
After
(
'
.btn-default
'
)
$
(
'
<
span
style="
position:absolute; top:5px; right:5px;
background-color: green;" class="badge badge-success">Saved</span>
'
)
.
insert
Before
(
'
.qfq-form-title>br
'
)
.
delay
(
3000
)
.
fadeOut
(
function
()
{
$
(
this
).
remove
();
});
if
(
window
.
location
.
search
!==
'
?
'
+
pageId
+
"
tt-content=
"
+
$
(
'
form
'
).
attr
(
'
id
'
)){
window
.
location
.
href
=
'
//
'
+
location
.
host
+
location
.
pathname
+
"
?
"
+
pageId
+
"
tt-content=
"
+
$
(
'
form
'
).
attr
(
'
id
'
);
}
return
false
;
});
// Refresh new window with correct url
if
(
$
(
externWindow
).
length
!==
0
&&
window
.
location
.
search
!==
'
?
'
+
pageId
+
"
tt-content=
"
+
$
(
'
form
'
).
attr
(
'
id
'
)){
window
.
location
.
href
=
'
//
'
+
location
.
host
+
location
.
pathname
+
"
?
"
+
pageId
+
"
tt-content=
"
+
$
(
'
form
'
).
attr
(
'
id
'
);
}
// enable CodeMirror for extern window
$
(
externWindow
).
children
(
"
[class=qfq-codemirror]
"
).
each
(
function
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment