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
4645df03
Commit
4645df03
authored
Jan 20, 2019
by
Carsten Rose
Browse files
Fixes #7684. Optional hide second button (cancel) in link/question alerts.
parent
d278b744
Pipeline
#1373
failed with stage
in 2 minutes and 15 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/Documentation/Manual.rst
View file @
4645df03
...
...
@@ -5616,7 +5616,7 @@ Question
+----------------------+--------------------------------------------------------------------------------------------------------------------------+
| Positive button text | Default: 'Ok' |
+----------------------+--------------------------------------------------------------------------------------------------------------------------+
| Negative button text | Default: 'Cancel'
|
| Negative button text | Default: 'Cancel'
. To hide the second button: '-'
|
+----------------------+--------------------------------------------------------------------------------------------------------------------------+
| Timeout in seconds | 0: no timeout, >0: after the specified time in seconds, the alert will dissapear and behaves like 'negative answer' |
+----------------------+--------------------------------------------------------------------------------------------------------------------------+
...
...
extension/Source/core/report/Link.php
View file @
4645df03
...
...
@@ -1094,14 +1094,16 @@ class Link {
$level
=
(
$arr
[
QUESTION_INDEX_LEVEL
]
===
''
)
?
DEFAULT_QUESTION_LEVEL
:
$arr
[
QUESTION_INDEX_LEVEL
];
$ok
=
(
$arr
[
QUESTION_INDEX_BUTTON_OK
]
===
''
)
?
'Ok'
:
$arr
[
QUESTION_INDEX_BUTTON_OK
];
$cancel
=
(
$arr
[
QUESTION_INDEX_BUTTON_FALSE
]
===
''
)
?
'Cancel'
:
$arr
[
QUESTION_INDEX_BUTTON_FALSE
];
$cancel
=
(
$cancel
==
'-'
)
?
''
:
", { label: '
$cancel
',eventName: 'cancel'}"
;
$timeout
=
(
$arr
[
QUESTION_INDEX_TIMEOUT
]
===
''
)
?
'0'
:
$arr
[
QUESTION_INDEX_TIMEOUT
]
*
1000
;
$flagModalStatus
=
(
$arr
[
QUESTION_INDEX_FLAG_MODAL
]
===
''
)
?
'1'
:
$arr
[
QUESTION_INDEX_FLAG_MODAL
];
$flagModal
=
(
$flagModalStatus
===
"1"
)
?
'true'
:
'false'
;
$js
=
<<<EOF
var alert = new QfqNS.Alert({ message: '$text', type: '$level', modal: $flagModal, timeout: $timeout, buttons: [
{ label: '$ok', eventName: 'ok' }
,
{ label: '$cancel',eventName: 'cancel'}
{ label: '$ok', eventName: 'ok' }
$cancel
] } );
alert.on('alert.ok', function() {
window.location = $('#$id').attr('href');
...
...
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