[TASK] Remove unused DeleteFileViewHelper 82/59582/2
authorGeorg Ringer <georg.ringer@gmail.com>
Wed, 30 Jan 2019 08:01:27 +0000 (09:01 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Wed, 30 Jan 2019 10:30:57 +0000 (11:30 +0100)
Since #72332 the url to the delete action is built in the controller and
assigned to the view.

Resolves: #87578
Releases: master
Change-Id: I36ea3374a848c48c981718dfc8dc1899dc9c0164
Reviewed-on: https://review.typo3.org/59582
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: TYPO3com <noreply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/filelist/Classes/ViewHelpers/Uri/DeleteFileViewHelper.php [deleted file]

diff --git a/typo3/sysext/filelist/Classes/ViewHelpers/Uri/DeleteFileViewHelper.php b/typo3/sysext/filelist/Classes/ViewHelpers/Uri/DeleteFileViewHelper.php
deleted file mode 100644 (file)
index 212df46..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-namespace TYPO3\CMS\Filelist\ViewHelpers\Uri;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use Closure;
-use TYPO3\CMS\Backend\Routing\UriBuilder;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
-
-/**
- * @internal
- */
-class DeleteFileViewHelper extends AbstractViewHelper
-{
-    use CompileWithRenderStatic;
-
-    /**
-     * Initialize arguments
-     */
-    public function initializeArguments()
-    {
-        $this->registerArgument('file', \TYPO3\CMS\Core\Resource\AbstractFile::class, '', true);
-        $this->registerArgument('returnUrl', 'string', '', false, '');
-    }
-
-    /**
-     * Renders a link to delete the file
-     *
-     * @param array $arguments
-     * @param Closure $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     *
-     * @return string
-     */
-    public static function renderStatic(array $arguments, Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        if (empty($arguments['returnUrl'])) {
-            $arguments['returnUrl'] = GeneralUtility::getIndpEnv('REQUEST_URI');
-        }
-
-        /** @var \TYPO3\CMS\Core\Resource\AbstractFile $file */
-        $file = $arguments['file'];
-
-        $params = [
-            'file' => [
-                'delete' => [
-                    0 => [
-                        'data' => $file->getCombinedIdentifier()
-                    ]
-                ]
-            ],
-            'redirect' => $arguments['returnUrl']
-        ];
-        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
-        return (string)$uriBuilder->buildUriFromRoute('tce_file', $params);
-    }
-}