[TASK] Replace RemoveUserViewHelper with ModuleLinkViewHelper 52/59552/2
authorGeorg Ringer <georg.ringer@gmail.com>
Wed, 23 Jan 2019 07:47:20 +0000 (08:47 +0100)
committerBenni Mack <benni@typo3.org>
Fri, 25 Jan 2019 05:25:23 +0000 (06:25 +0100)
Resolves: #87523
Releases: master
Change-Id: I711ddb140e03e87b38ec06a7814e4b488bc9e9c9
Reviewed-on: https://review.typo3.org/59552
Tested-by: TYPO3com <noreply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Jan Stockfisch <typo3@jan-stockfisch.de>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/beuser/Classes/ViewHelpers/RemoveUserViewHelper.php [deleted file]
typo3/sysext/beuser/Resources/Private/Partials/BackendUser/IndexListRow.html

diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/RemoveUserViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/RemoveUserViewHelper.php
deleted file mode 100644 (file)
index 254d030..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-namespace TYPO3\CMS\Beuser\ViewHelpers;
-
-/*
- * 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 TYPO3\CMS\Backend\Routing\UriBuilder;
-use TYPO3\CMS\Beuser\Domain\Model\BackendUser;
-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;
-
-/**
- * Renders 'Delete user' link
- *
- * @internal
- */
-class RemoveUserViewHelper extends AbstractViewHelper
-{
-    use CompileWithRenderStatic;
-
-    /**
-     * Initializes the arguments
-     */
-    public function initializeArguments()
-    {
-        $this->registerArgument('backendUser', BackendUser::class, 'Target backendUser to switch active session to', true);
-    }
-
-    /**
-     * Renders the URL to remove a user.
-     *
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     *
-     * @return string
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $urlParameters = [
-            'cmd[be_users][' . $arguments['backendUser']->getUid() . '][delete]' => 1,
-            'redirect' => GeneralUtility::getIndpEnv('REQUEST_URI')
-        ];
-        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
-        return (string)$uriBuilder->buildUriFromRoute('tce_db', $urlParameters);
-    }
-}
index 0b9a8a8..e74cb7c 100644 (file)
@@ -59,7 +59,7 @@
                                        <span class="btn btn-default disabled"><core:icon identifier="empty-empty" /></span>
                                </f:then>
                                <f:else>
-                                       <a class="btn btn-default t3js-modal-trigger" href="{bu:removeUser(backendUser:backendUser)}"
+                                       <a class="btn btn-default t3js-modal-trigger" href="{be:moduleLink(route:'tce_db', query:'cmd[be_users][{backendUser.uid}][delete]=1', currentUrlParameterName:'redirect')}"
                                                 title="{f:translate(key:'LLL:EXT:beuser/Resources/Private/Language/locallang.xlf:delete')}"
                                                 data-severity="warning"
                                                 data-title="{f:translate(key:'LLL:EXT:backend/Resources/Private/Language/locallang_alt_doc.xlf:label.confirm.delete_record.title')}"