Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
d1bb65ef
Commit
d1bb65ef
authored
Sep 01, 2019
by
Carsten Rose
Browse files
Fixes #7849. New option 'fileTrash' and 'fileTrashText'.
parent
af5e6844
Pipeline
#2327
passed with stages
in 2 minutes and 53 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Documentation/Manual.rst
View file @
d1bb65ef
...
...
@@ -2998,6 +2998,8 @@ See also at specific *FormElement* definitions.
| accept, | | |
| maxFileSize, | | |
| fileDestination, | | |
| fileTrash, | | |
| fileTrashText, | | |
| fileReplace, | | |
| autoOrient, | | |
| autoOrientCmd, | | |
...
...
@@ -3826,6 +3828,11 @@ See also `downloadButton`_ to offer a download of an uploaded file.
* *maxFileSize* = `
<size>
` - max filesize in bytes (no unit), kilobytes (k/K) or megabytes (m/M) for an uploaded file.
If empty or not given, take value from Form, System or System default.
* *fileTrash* = [0|1] - Default: '1'. This option en-/disables the trash button right beside the file chooser. By default
the trash is visible. The trash is only visible if a) there is already a file uploaded or b) a new file has been chosen.
* *fileTrashText* = `
<string>
` - Default: ''. Will be shown right beside the trash glyph-icon.
* *fileDestination* = `
<pathFileName>
` - Destination where to copy the file. A good practice is to specify a relative `fileDestination` -
such an installation (filesystem and database) are moveable.
...
...
extension/Classes/Core/AbstractBuildForm.php
View file @
d1bb65ef
...
...
@@ -3129,7 +3129,10 @@ abstract class AbstractBuildForm {
$disabled
=
(
$formElement
[
FE_MODE
]
==
FE_MODE_READONLY
)
?
'disabled'
:
''
;
$deleteButton
=
Support
::
wrapTag
(
"<button type='button' class='btn btn-default delete-file
$disabled
'
$disabled
data-sip='
$sipUpload
' name='delete-
$htmlFormElementName
'>"
,
$this
->
symbol
[
SYMBOL_DELETE
]);
if
(
!
empty
(
$formElement
[
FE_FILE_TRASH_TEXT
]))
{
$formElement
[
FE_FILE_TRASH_TEXT
]
=
' '
.
$formElement
[
FE_FILE_TRASH_TEXT
];
}
$deleteButton
=
Support
::
wrapTag
(
"<button type='button' class='btn btn-default delete-file
$disabled
'
$disabled
data-sip='
$sipUpload
' name='delete-
$htmlFormElementName
'>"
,
$this
->
symbol
[
SYMBOL_DELETE
]
.
$formElement
[
FE_FILE_TRASH_TEXT
]);
if
(
Support
::
isEnabled
(
$formElement
,
FE_FILE_DOWNLOAD_BUTTON
))
{
if
(
is_readable
(
$value
))
{
...
...
@@ -3147,7 +3150,11 @@ abstract class AbstractBuildForm {
}
$htmlFilename
=
Support
::
wrapTag
(
"<span class='uploaded-file-name'>"
,
$value
,
false
);
$htmlTextDelete
=
Support
::
wrapTag
(
"<div class='uploaded-file
$textDeleteClass
'>"
,
$htmlFilename
.
' '
.
$deleteButton
);
if
((
$formElement
[
FE_FILE_TRASH
]
??
'1'
)
==
'1'
)
{
$htmlTextDelete
=
Support
::
wrapTag
(
"<div class='uploaded-file
$textDeleteClass
'>"
,
$htmlFilename
.
' '
.
$deleteButton
);
}
else
{
$htmlTextDelete
=
$htmlFilename
;
}
// <button type="button" class="file-delete" data-sip="571d1fc9e6974"><span class="glyphicon glyphicon-trash"></span></button>
$formElement
=
HelperFormElement
::
prepareExtraButton
(
$formElement
,
false
);
...
...
extension/Classes/Core/Constants.php
View file @
d1bb65ef
...
...
@@ -1119,6 +1119,8 @@ const FE_FILE_CHMOD_FILE = 'chmodFile';
const
FE_FILE_CHMOD_DIR
=
'chmodDir'
;
const
FE_TRIM
=
'trim'
;
// 'none' | list of characters
const
FE_TRIM_NONE
=
'none'
;
const
FE_FILE_TRASH
=
'fileTrash'
;
const
FE_FILE_TRASH_TEXT
=
'fileTrashText'
;
// Excel Import
const
FE_IMPORT_TO_TABLE
=
'importToTable'
;
...
...
Write
Preview
Markdown
is supported
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