[TASK] Use ModuleLinkViewHelper instead of IssueCommandViewHelper 13/59513/2
authorGeorg Ringer <georg.ringer@gmail.com>
Mon, 21 Jan 2019 14:20:59 +0000 (15:20 +0100)
committerBenni Mack <benni@typo3.org>
Tue, 29 Jan 2019 05:56:01 +0000 (06:56 +0100)
Use the general ModuleLinkViewHelper instead of custom VH.

Resolves: #87509
Releases: master
Change-Id: I7f0d7125d0ee84973bc80599cbc51e44747e2d06
Reviewed-on: https://review.typo3.org/59513
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: Fabien Udriot <fabien.udriot@ecodev.ch>
Tested-by: Fabien Udriot <fabien.udriot@ecodev.ch>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Tested-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/IssueCommandViewHelper.php [deleted file]
typo3/sysext/beuser/Resources/Private/Partials/BackendUser/IndexListRow.html
typo3/sysext/beuser/Resources/Private/Partials/BackendUserGroup/IndexListRow.html
typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Compare.html

diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/IssueCommandViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/IssueCommandViewHelper.php
deleted file mode 100644 (file)
index c677911..0000000
+++ /dev/null
@@ -1,62 +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\Core\Utility\GeneralUtility;
-use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
-
-/**
- * Render a link to DataHandler command
- * @internal
- */
-class IssueCommandViewHelper extends AbstractViewHelper
-{
-    use CompileWithRenderStatic;
-
-    /**
-     * Initializes the arguments
-     */
-    public function initializeArguments()
-    {
-        $this->registerArgument('parameters', 'string', 'Is a set of GET params to send to route tce_db (SimpleDataHandlerController). Example: "&cmd[tt_content][123][move]=456" or "&data[tt_content][123][hidden]=1&data[tt_content][123][title]=Hello%20World', true);
-        $this->registerArgument('redirectUrl', 'string', 'Redirect URL if any other that \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv(\'REQUEST_URI\') is preferred', false, '');
-    }
-
-    /**
-     * Returns a URL with a command to TYPO3 Core Engine - DataHandler (route tce_db)
-     *
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     *
-     * @return string URL to tce_db + parameters
-     * @see \TYPO3\CMS\Backend\Utility\BackendUtility::getLinkToDataHandlerAction()
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $urlParameters = [
-            'redirect' => $arguments['redirectUrl'] ?: GeneralUtility::getIndpEnv('REQUEST_URI')
-        ];
-        if (isset($arguments['parameters'])) {
-            $parametersArray = GeneralUtility::explodeUrl2Array($arguments['parameters']);
-            $urlParameters += $parametersArray;
-        }
-        /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
-        $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
-        return (string)$uriBuilder->buildUriFromRoute('tce_db', $urlParameters);
-    }
-}
index e74cb7c..6f14015 100644 (file)
                                <f:else>
                                        <f:if condition="{backendUser.isDisabled} == 1">
                                                <f:then>
-                                                       <a class="btn btn-default" href="{bu:issueCommand(parameters: 'data[be_users][{backendUser.uid}][disable]=0', redirectUrl: redirectUrl)}" title="{f:translate(key:'visibility.unhide')}"><core:icon identifier="actions-edit-unhide" /></a>
+                                                       <a class="btn btn-default" href="{be:moduleLink(route:'tce_db', query:'data[be_users][{backendUser.uid}][disable]=0', currentUrlParameterName:'redirect')}" title="{f:translate(key:'visibility.unhide')}"><core:icon identifier="actions-edit-unhide" /></a>
                                                </f:then>
                                                <f:else>
-                                                       <a class="btn btn-default" href="{bu:issueCommand(parameters: 'data[be_users][{backendUser.uid}][disable]=1', redirectUrl: redirectUrl)}" title="{f:translate(key:'visibility.hide')}"><core:icon identifier="actions-edit-hide" /></a>
+                                                       <a class="btn btn-default" href="{be:moduleLink(route:'tce_db', query:'data[be_users][{backendUser.uid}][disable]=1', currentUrlParameterName:'redirect')}" title="{f:translate(key:'visibility.hide')}"><core:icon identifier="actions-edit-hide" /></a>
                                                </f:else>
                                        </f:if>
                                </f:else>
index 808b949..1a1e0a6 100644 (file)
                        </be:link.editRecord>
                        <f:if condition="{backendUserGroup.hidden}">
                                <f:then>
-                                       <a class="btn btn-default" href="{bu:issueCommand(parameters: 'data[be_groups][{backendUserGroup.uid}][hidden]=0', redirectUrl: redirectUrl)}" title="{f:translate(key:'visibility.unhide')}"><core:icon identifier="actions-edit-unhide" /></a>
+                                       <a class="btn btn-default" href="{be:moduleLink(route:'tce_db', query:'data[be_groups][{backendUserGroup.uid}][hidden]=0', currentUrlParameterName:'redirect')}" title="{f:translate(key:'visibility.unhide')}"><core:icon identifier="actions-edit-unhide" /></a>
                                </f:then>
                                <f:else>
-                                       <a class="btn btn-default" href="{bu:issueCommand(parameters: 'data[be_groups][{backendUserGroup.uid}][hidden]=1', redirectUrl: redirectUrl)}" title="{f:translate(key:'visibility.hide')}"><core:icon identifier="actions-edit-hide" /></a>
+                                       <a class="btn btn-default" href="{be:moduleLink(route:'tce_db', query:'data[be_groups][{backendUserGroup.uid}][hidden]=1', currentUrlParameterName:'redirect')}" title="{f:translate(key:'visibility.hide')}"><core:icon identifier="actions-edit-hide" /></a>
                                </f:else>
                        </f:if>
                </div>
index dd211af..dce9963 100644 (file)
                                                        <f:if condition="{compareUser.currentlyLoggedIn} == 0">
                                                                <f:if condition="{compareUser.isDisabled} == 1">
                                                                        <f:then>
-                                                                               <a class="btn btn-default" href="{bu:issueCommand(parameters: 'data[be_users][{compareUser.uid}][disable]=0', redirectUrl: redirectUrl)}" title="{f:translate(key: 'visibility.unhide')}">
+                                                                               <a class="btn btn-default" href="{be:moduleLink(route:'tce_db', query:'data[be_users][{compareUser.uid}][disable]=0', currentUrlParameterName:'redirect')}" title="{f:translate(key: 'visibility.unhide')}">
                                                                                        <core:icon identifier="actions-edit-unhide" />
                                                                                </a>
                                                                        </f:then>
                                                                        <f:else>
-                                                                               <a class="btn btn-default" href="{bu:issueCommand(parameters: 'data[be_users][{compareUser.uid}][disable]=1', redirectUrl: redirectUrl)}" title="{f:translate(key: 'visibility.hide')}">
+                                                                               <a class="btn btn-default" href="{be:moduleLink(route:'tce_db', query:'data[be_users][{compareUser.uid}][disable]=1', currentUrlParameterName:'redirect')}" title="{f:translate(key: 'visibility.hide')}">
                                                                                        <core:icon identifier="actions-edit-hide" />
                                                                                </a>
                                                                        </f:else>