Commit e6878c49 authored by Andreas Fernandez's avatar Andreas Fernandez Committed by Christian Kuhn
Browse files

[!!!][TASK] Migrate file edit form to FormEngine

To simplify the overhaul of EXT:t3editor, the form to change a file's
content is based on FormEngine now.

Additionally, the file rename form has been streamlined to the overall
backend visual appearance.

Resolves: #81763
Releases: master
Change-Id: Ifb9bc5513bff923a6d4cdbcb6046e87f4dcf3626
Reviewed-on: https://review.typo3.org/53129


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 5513a2b7
......@@ -16,14 +16,19 @@ namespace TYPO3\CMS\Backend\Controller\File;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Backend\Form\FormResultCompiler;
use TYPO3\CMS\Backend\Form\NodeFactory;
use TYPO3\CMS\Backend\Module\AbstractModule;
use TYPO3\CMS\Backend\Template\Components\ButtonBar;
use TYPO3\CMS\Backend\Template\DocumentTemplate;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageService;
use TYPO3\CMS\Core\Resource\Exception\InsufficientFileAccessPermissionsException;
use TYPO3\CMS\Core\Resource\ResourceFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\HttpUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
/**
......@@ -138,10 +143,21 @@ class EditFileController extends AbstractModule
}
/**
* Main function, redering the actual content of the editing page
* Main function, rendering the actual content of the editing page
*/
public function main()
{
$dataColumnDefinition = [
'label' => htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf:file'))
. ' ' . htmlspecialchars($this->target),
'config' => [
'type' => 'text',
'cols' => 48,
'wrap' => 'OFF',
],
'defaultExtras' => 'fixed-font: enable-tab'
];
$this->getButtons();
// Hook: before compiling the output
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'])) {
......@@ -149,7 +165,8 @@ class EditFileController extends AbstractModule
if (is_array($preOutputProcessingHook)) {
$hookParameters = [
'content' => &$this->content,
'target' => &$this->target
'target' => &$this->target,
'dataColumnDefinition' => &$dataColumnDefinition,
];
foreach ($preOutputProcessingHook as $hookFunction) {
GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
......@@ -164,22 +181,67 @@ class EditFileController extends AbstractModule
$extList = $GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext'];
try {
if (!$extList || !GeneralUtility::inList($extList, $this->fileObject->getExtension())) {
throw new \Exception('Files with that extension are not editable.', 1476050135);
throw new \Exception('Files with that extension are not editable. Allowed extensions are: ' . $extList, 1476050135);
}
// Read file content to edit:
$fileContent = $this->fileObject->getContents();
// Making the formfields
$hValue = BackendUtility::getModuleUrl('file_edit', [
'target' => $this->origTarget,
'returnUrl' => $this->returnUrl
]);
$assigns['uid'] = $this->fileObject->getUid();
$assigns['fileContent'] = $fileContent;
$assigns['hValue'] = $hValue;
$formData = [
'databaseRow' => [
'uid' => 0,
'data' => $this->fileObject->getContents(),
'target' => $this->fileObject->getUid(),
'redirect' => $hValue,
],
'tableName' => 'editfile',
'processedTca' => [
'columns' => [
'data' => $dataColumnDefinition,
'target' => [
'config' => [
'type' => 'input',
'renderType' => 'hidden',
],
],
'redirect' => [
'config' => [
'type' => 'input',
'renderType' => 'hidden',
],
],
],
'types' => [
1 => [
'showitem' => 'data,target,redirect',
],
],
],
'recordTypeValue' => 1,
'inlineStructure' => [],
'renderType' => 'fullRecordContainer',
];
$resultArray = GeneralUtility::makeInstance(NodeFactory::class)->create($formData)->render();
$formResultCompiler = GeneralUtility::makeInstance(FormResultCompiler::class);
$formResultCompiler->mergeResult($resultArray);
$form = $formResultCompiler->addCssFiles()
. $resultArray['html']
. $formResultCompiler->printNeededJSFunctions();
$assigns['form'] = $form;
} catch (\Exception $e) {
$assigns['extList'] = $extList;
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $e->getMessage(), '', FlashMessage::ERROR, true);
$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
$defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
$defaultFlashMessageQueue->enqueue($flashMessage);
HttpUtility::redirect($this->returnUrl, HttpUtility::HTTP_STATUS_500);
}
// Rendering of the output via fluid
......@@ -227,8 +289,6 @@ class EditFileController extends AbstractModule
/**
* Builds the buttons for the docheader and returns them as an array
*
* @return array
*/
public function getButtons()
{
......@@ -246,6 +306,7 @@ class EditFileController extends AbstractModule
->setName('_save')
->setValue('1')
->setOnClick('document.editform.submit();')
->setForm('EditFileController')
->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_edit.php.submit'))
->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-save', Icon::SIZE_SMALL));
......@@ -253,6 +314,7 @@ class EditFileController extends AbstractModule
$saveAndCloseButton = $buttonBar->makeInputButton()
->setName('_saveandclose')
->setValue('1')
->setForm('EditFileController')
->setOnClick(
'document.editform.redirect.value='
. GeneralUtility::quoteJSvalue($this->returnUrl)
......
......@@ -92,8 +92,16 @@ class FileController
protected function init()
{
// Set the GPvars from outside
$this->file = GeneralUtility::_GP('file');
$this->file = GeneralUtility::_GP('data');
if ($this->file === null) {
// This happens in clipboard mode only
$this->redirect = GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GP('redirect'));
} else {
$mode = key($this->file);
$this->redirect = GeneralUtility::sanitizeLocalUrl($this->file[$mode][0]['redirect']);
}
$this->CB = GeneralUtility::_GP('CB');
if (isset($this->file['rename'][0]['conflictMode'])) {
$conflictMode = $this->file['rename'][0]['conflictMode'];
unset($this->file['rename'][0]['conflictMode']);
......@@ -101,7 +109,6 @@ class FileController
} else {
$this->overwriteExistingFiles = DuplicationBehavior::cast(GeneralUtility::_GP('overwriteExistingFiles'));
}
$this->redirect = GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GP('redirect'));
$this->initClipboard();
$this->fileProcessor = GeneralUtility::makeInstance(ExtendedFileUtility::class);
}
......
......@@ -180,8 +180,8 @@ class FileUploadController extends AbstractModule
// Adding 'size="50" ' for the sake of Mozilla!
$content .= '
<input type="file" multiple="multiple" name="upload_1[]" />
<input type="hidden" name="file[upload][1][target]" value="' . htmlspecialchars($this->folderObject->getCombinedIdentifier()) . '" />
<input type="hidden" name="file[upload][1][data]" value="1" /><br />
<input type="hidden" name="data[upload][1][target]" value="' . htmlspecialchars($this->folderObject->getCombinedIdentifier()) . '" />
<input type="hidden" name="data[upload][1][data]" value="1" /><br />
';
$content .= '
</div>
......
......@@ -17,9 +17,12 @@ namespace TYPO3\CMS\Backend\Controller\File;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Backend\Module\AbstractModule;
use TYPO3\CMS\Backend\Template\Components\ButtonBar;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Resource\DuplicationBehavior;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\Folder;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
......@@ -46,7 +49,7 @@ class RenameFileController extends AbstractModule
/**
* The file or folder object that should be renamed
*
* @var \TYPO3\CMS\Core\Resource\File|\TYPO3\CMS\Core\Resource\Folder $fileOrFolderObject
* @var File|Folder $fileOrFolderObject
*/
protected $fileOrFolderObject;
......@@ -102,7 +105,7 @@ class RenameFileController extends AbstractModule
// so the redirect will NOT end in an error message
// this case only happens if you select the folder itself in the foldertree and then use the clickmenu to
// rename the folder
if ($this->fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\Folder) {
if ($this->fileOrFolderObject instanceof Folder) {
$parsedUrl = parse_url($this->returnUrl);
$queryParts = GeneralUtility::explodeUrl2Array(urldecode($parsedUrl['query']));
if ($queryParts['id'] === $this->fileOrFolderObject->getCombinedIdentifier()) {
......@@ -138,16 +141,19 @@ class RenameFileController extends AbstractModule
$assigns['moduleUrlTceFile'] = BackendUtility::getModuleUrl('tce_file');
$assigns['returnUrl'] = $this->returnUrl;
if ($this->fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\Folder) {
if ($this->fileOrFolderObject instanceof Folder) {
$fileIdentifier = $this->fileOrFolderObject->getCombinedIdentifier();
$targetLabel = 'file_rename.php.label.target.folder';
} else {
$fileIdentifier = $this->fileOrFolderObject->getUid();
$targetLabel = 'file_rename.php.label.target.file';
$assigns['conflictMode'] = DuplicationBehavior::cast(DuplicationBehavior::RENAME);
$assigns['destination'] = substr($this->fileOrFolderObject->getCombinedIdentifier(), 0, -strlen($this->fileOrFolderObject->getName()));
}
$assigns['fileName'] = $this->fileOrFolderObject->getName();
$assigns['fileIdentifier'] = $fileIdentifier;
$assigns['fieldLabel'] = $targetLabel;
// Create buttons
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
......@@ -163,10 +169,22 @@ class RenameFileController extends AbstractModule
$backButton = $buttonBar->makeLinkButton()
->setHref($this->returnUrl)
->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.goBack'))
->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-view-go-back', Icon::SIZE_SMALL));
->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-close', Icon::SIZE_SMALL));
$buttonBar->addButton($backButton);
}
// Save and Close button
$saveAndCloseButton = $buttonBar->makeInputButton()
->setName('_saveandclose')
->setValue('1')
->setShowLabelText(true)
->setClasses('t3js-submit-file-rename')
->setForm('RenameFileController')
->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_edit.php.saveAndClose'))
->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-save-close', Icon::SIZE_SMALL));
$buttonBar->addButton($saveAndCloseButton, ButtonBar::BUTTON_POSITION_LEFT, 20);
$this->moduleTemplate->getPageRenderer()->addInlineLanguageLabelArray([
'file_rename.actions.cancel' => $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_rename.actions.cancel'),
'file_rename.actions.rename' => $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_rename.actions.rename'),
......
......@@ -24,8 +24,8 @@
<div class="form-group">
<label for="folder_new_{folder.this}"><f:translate key="LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_newfolder.php.label_newfolder" /> {folder.next}:</label>
<div class="form-control-wrap">
<input type="text" class="form-control" id="folder_new_{folder.this}" name="file[newfolder][{folder.this}][data]" onchange="changed=true;" />
<input type="hidden" name="file[newfolder][{folder.this}][target]" value="{target}" />
<input type="text" class="form-control" id="folder_new_{folder.this}" name="data[newfolder][{folder.this}][data]" onchange="changed=true;" />
<input type="hidden" name="data[newfolder][{folder.this}][target]" value="{target}" />
</div>
</div>
</div>
......@@ -33,7 +33,7 @@
</div>
<div class="form-group">
<input class="btn btn-default" type="submit" value="{f:translate(key: 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_newfolder.php.submit')}" />
<input type="hidden" name="redirect" value="{returnUrl}" />
<input type="hidden" name="data[newfolder][0][redirect]" value="{returnUrl}" />
</div>
</form>
</div>
......@@ -47,9 +47,9 @@
<div class="form-group">
<label for="newMedia"><f:translate key="LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:online_media.new_media.label" /></label> {cshFileNewMedia -> f:format.raw()}
<div class="form-control-wrap">
<input class="form-control" type="text" id="newMedia" name="file[newMedia][0][url]"
<input class="form-control" type="text" id="newMedia" name="data[newMedia][0][url]"
placeholder="{f:translate(key: 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:online_media.new_media.placeholder')}" />
<input type="hidden" name="file[newMedia][0][target]" value="{target}" />
<input type="hidden" name="data[newMedia][0][target]" value="{target}" />
</div>
<div class="help-block">
<f:translate key="LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:online_media.new_media.allowedProviders" /><br>
......@@ -62,7 +62,7 @@
</div>
<div class="form-group">
<input class="btn btn-default" type="submit" value="{f:translate(key: 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:online_media.new_media.submit')}" />
<input type="hidden" name="redirect" value="{returnUrl}" />
<input type="hidden" name="data[newMedia][0][redirect]" value="{returnUrl}" />
</div>
</div>
</form>
......@@ -74,8 +74,8 @@
<div class="form-group">
<label for="newfile"><f:translate key="LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_newfolder.php.label_newfile" /></label> {cshFileNewFile -> f:format.raw()}
<div class="form-control-wrap">
<input class="form-control" type="text" id="newfile" name="file[newfile][0][data]" onchange="changed=true;" />
<input type="hidden" name="file[newfile][0][target]" value="{target}" />
<input class="form-control" type="text" id="newfile" name="data[newfile][0][data]" onchange="changed=true;" />
<input type="hidden" name="data[newfile][0][target]" value="{target}" />
</div>
<div class="help-block">
<f:translate key="LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.allowedFileExtensions" /><br>
......@@ -88,7 +88,7 @@
</div>
<div class="form-group">
<button class="btn btn-default" name="edit" type="submit" value="1"><f:translate key="LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_newfolder.php.newfile_submit" /></button>
<input type="hidden" name="redirect" value="{returnUrl}" />
<input type="hidden" name="data[newfile][0][redirect]" value="{returnUrl}" />
</div>
</div>
</form>
......
<form action="{moduleUrlTceFile}" method="post" id="EditFileController" name="editform">
<h1><f:translate key="LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_edit.php.pagetitle" /> {fileName}</h1>
<div id="c-edit">
<textarea rows="30" name="file[editfile][0][data]" wrap="off" class="form-control text-monospace t3js-enable-tab">{fileContent}</textarea>
<input type="hidden" name="file[editfile][0][target]" value="{uid}" />
<input type="hidden" name="redirect" value="{hValue}" />
</div>
<br />
<f:if condition="{extList}">
<f:format.raw>
<f:translate key="LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_edit.php.coundNot" arguments="{0: extList}" />
</f:format.raw>
</f:if>
<f:format.raw>{form}</f:format.raw>
</form>
<h1>
<f:translate key="LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_rename.php.pagetitle"/>
</h1>
<div>
<form action="{moduleUrlTceFile}" method="post" name="editform" role="form">
<div class="form-group">
<input class="form-control" type="text" name="file[rename][0][target]" value="{fileName}"
data-original="{fileName}" style="width:384px;"/>
<input type="hidden" name="file[rename][0][data]" value="{fileIdentifier}"/>
<f:if condition="{destination}">
<input type="hidden" name="file[rename][0][destination]" value="{destination}"/>
<input type="hidden" name="file[rename][0][conflictMode]" value="{conflictMode}"/>
</f:if>
<form action="{moduleUrlTceFile}" method="post" name="editform" role="form" id="RenameFileController">
<fieldset class="form-section">
<div class="row">
<div class="form-group col-md-12">
<label class="t3js-formengine-label" for="rename_target">
<f:translate key="LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:{fieldLabel}" />
</label>
<div class="formengine-field-item">
<div class="form-control-wrap">
<div class="form-wizards-wrap">
<div class="form-wizards-element">
<input id="rename_target" class="form-control" type="text" name="data[rename][0][target]" value="{fileName}" data-original="{fileName}" />
</div>
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
<input class="btn btn-primary t3js-submit-file-rename" type="submit"
value="{f:translate(key: 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_rename.php.submit')}"/>
<input class="btn btn-danger" type="submit"
value="{f:translate(key: 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.cancel')}"
onclick="backToList(); return false;"/>
<input type="hidden" name="redirect" value="{returnUrl}"/>
</div>
</form>
</div>
</fieldset>
<f:if condition="{destination}">
<input type="hidden" name="data[rename][0][destination]" value="{destination}"/>
<input type="hidden" name="data[rename][0][conflictMode]" value="{conflictMode}"/>
</f:if>
<input type="hidden" name="data[rename][0][data]" value="{fileIdentifier}"/>
<input type="hidden" name="data[rename][0][redirect]" value="{returnUrl}"/>
</form>
\ No newline at end of file
......@@ -33,16 +33,16 @@ class RenameFile {
private checkForDuplicate(e: any): void {
e.preventDefault();
const form: any = $(e.currentTarget).closest('form');
const fileNameField: any = form.find('input[name="file[rename][0][target]"]');
const conflictModeField: any = form.find('input[name="file[rename][0][conflictMode]"]');
const form: any = $('#' + $(e.currentTarget).attr('form'));
const fileNameField: any = form.find('input[name="data[rename][0][target]"]');
const conflictModeField: any = form.find('input[name="data[rename][0][conflictMode]"]');
const ajaxUrl: string = TYPO3.settings.ajaxUrls.file_exists;
$.ajax({
cache: false,
data: {
fileName: fileNameField.val(),
fileTarget: form.find('input[name="file[rename][0][destination]"]').val(),
fileTarget: form.find('input[name="data[rename][0][destination]"]').val(),
},
success: (response: any): void => {
const fileExists: boolean = response !== false;
......
......@@ -562,8 +562,8 @@ define(['jquery',
me.updateMessage('- ' + DragUploader.fileSizeAsString(me.file.size));
var formData = new FormData();
formData.append('file[upload][1][target]', me.dragUploader.target);
formData.append('file[upload][1][data]', '1');
formData.append('data[upload][1][target]', me.dragUploader.target);
formData.append('data[upload][1][data]', '1');
formData.append('overwriteExistingFiles', me.override);
formData.append('redirect', '');
formData.append('upload_1', me.file);
......
......@@ -26,15 +26,15 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Ba
};
RenameFile.prototype.checkForDuplicate = function (e) {
e.preventDefault();
var form = $(e.currentTarget).closest('form');
var fileNameField = form.find('input[name="file[rename][0][target]"]');
var conflictModeField = form.find('input[name="file[rename][0][conflictMode]"]');
var form = $('#' + $(e.currentTarget).attr('form'));
var fileNameField = form.find('input[name="data[rename][0][target]"]');
var conflictModeField = form.find('input[name="data[rename][0][conflictMode]"]');
var ajaxUrl = TYPO3.settings.ajaxUrls.file_exists;
$.ajax({
cache: false,
data: {
fileName: fileNameField.val(),
fileTarget: form.find('input[name="file[rename][0][destination]"]').val(),
fileTarget: form.find('input[name="data[rename][0][destination]"]').val(),
},
success: function (response) {
var fileExists = response !== false;
......
.. include:: ../../Includes.txt
================================================================================================
Breaking: #81763 - Hook parameters of ['typo3/file_edit.php']['preOutputProcessingHook'] changed
================================================================================================
See :issue:`81763`
Description
===========
The hook parameters passed into :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook']`
have been changed due to rewriting the edit file form to use FormEngine.
Impact
======
Any information added to modify the output may have no effect anymore.
Affected Installations
======================
Every installation using an extension that hooks into :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook']`
to modify the form's output is affected.
Migration
=========
As the form is based on FormEngine now, you may want to adjust the newly introduced hook parameter :php:`$dataColumnDefinition`,
representing the definition of the `data` field which contains the file content. An example can be found in EXT:t3editor.
.. index:: Backend
\ No newline at end of file
.. include:: ../../Includes.txt
===============================================================
Deprecation: #81763 - Deprecated language label for file rename
===============================================================
See :issue:`81763`
Description
===========
The language label `file_rename.php.submit` in `EXT:lang/Resources/Private/Language/locallang_core.xlf` has been marked as deprecated.
Affected Installations
======================
Any TYPO3 extension using the deprecated label is affected.
Migration
=========
Add the label to the `locallang.xlf` of your extension and adjust the usage of the label.
.. index:: Backend
\ No newline at end of file
......@@ -71,7 +71,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func
var $anchorElement = $(this);
var performDelete = function () {
top.TYPO3.Backend.ContentContainer.setUrl(
top.TYPO3.settings.FileCommit.moduleUrl + '&file[delete][0][data]=' + top.rawurlencode(uid) + '&redirect=' + ContextMenuActions.getReturnUrl()
top.TYPO3.settings.FileCommit.moduleUrl + '&data[delete][0][data]=' + top.rawurlencode(uid) + '&data[delete][0][redirect]=' + ContextMenuActions.getReturnUrl()
);
};
if (!$anchorElement.data('title')) {
......
......@@ -28,7 +28,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func
}
var identifier = $anchorElement.data('identifier');
var deleteType = $anchorElement.data('deleteType');
var deleteUrl = $anchorElement.data('deleteUrl') + '&file[delete][0][data]=' + encodeURIComponent(identifier);
var deleteUrl = $anchorElement.data('deleteUrl') + '&data[delete][0][data]=' + encodeURIComponent(identifier);
if ($anchorElement.data('check')) {
var $modal = Modal.confirm($anchorElement.data('title'), $anchorElement.data('content'), Severity.warning, [
{
......@@ -48,11 +48,11 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func
Modal.dismiss();
} else if (e.target.name === 'yes') {
Modal.dismiss();
top.list_frame.location.href = deleteUrl + '&redirect=' + redirectUrl;
top.list_frame.location.href = deleteUrl + '&data[delete][0][redirect]=' + redirectUrl;
}
});
} else {
top.list_frame.location.href = deleteUrl + '&redirect=' + redirectUrl;
top.list_frame.location.href = deleteUrl + '&data[delete][0][redirect]=' + redirectUrl;
}
});
......
......@@ -6,8 +6,8 @@
</h4>
<div class="form-group">
<f:form.upload name="upload_1" />
<f:form.hidden name="file[upload][1][target]" value="{tempFolder}" />
<f:form.hidden name="file[upload][1][data]" value="1" />
<f:form.hidden name="data[upload][1][target]" value="{tempFolder}" />
<f:form.hidden name="data[upload][1][data]" value="1" />
</div>
<div class="form-group">
<f:form.submit class="btn btn-default" name="_upload" value="{f:translate(key: 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:file_upload.php.submit')}" />
......
......@@ -633,6 +633,13 @@ Do you want to continue WITHOUT saving?</source>
</trans-unit>
<trans-unit id="file_rename.php.submit">
<source>Rename</source>