[TASK] Replace ModuleLinkViewHelper of EXT:scheduler with ModuleLinkViewHelper of... 83/59583/2
authorGeorg Ringer <georg.ringer@gmail.com>
Wed, 30 Jan 2019 08:25:09 +0000 (09:25 +0100)
committerAndreas Wolf <andreas.wolf@typo3.org>
Fri, 1 Feb 2019 11:30:55 +0000 (12:30 +0100)
Resolves: #87579
Releases: master
Change-Id: I04e8d291a030dac0a0df526e46aa40ba27a24b39
Reviewed-on: https://review.typo3.org/59583
Tested-by: TYPO3com <noreply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
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: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
typo3/sysext/scheduler/Classes/ViewHelpers/ModuleLinkViewHelper.php [deleted file]
typo3/sysext/scheduler/Resources/Private/Templates/Backend/SchedulerModule/InfoScreen.html

diff --git a/typo3/sysext/scheduler/Classes/ViewHelpers/ModuleLinkViewHelper.php b/typo3/sysext/scheduler/Classes/ViewHelpers/ModuleLinkViewHelper.php
deleted file mode 100644 (file)
index 7e43d9e..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php
-namespace TYPO3\CMS\Scheduler\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\Core\Utility\GeneralUtility;
-use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
-
-/**
- * Create internal link within backend app
- * @internal
- */
-class ModuleLinkViewHelper extends AbstractViewHelper
-{
-    use CompileWithRenderStatic;
-
-    /**
-     * Initializes the arguments
-     */
-    public function initializeArguments()
-    {
-        $this->registerArgument('controller', 'string', 'The "controller" of scheduler. Possible values are "scheduler", "check", "info"', true);
-        $this->registerArgument('action', 'string', 'The action to be called within each controller', true);
-        $this->registerArgument('arguments', 'array', '', false, []);
-    }
-
-    /**
-     * Render module link with command and arguments
-     *
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     *
-     * @return string
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $moduleArguments = [];
-        $moduleArguments['SET']['function'] = $arguments['controller'];
-        $moduleArguments['CMD'] = $arguments['action'];
-        if (!empty($arguments['arguments'])) {
-            $moduleArguments['tx_scheduler'] = $arguments['arguments'];
-        }
-
-        $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
-        return (string)$uriBuilder->buildUriFromRoute('system_txschedulerM1', $moduleArguments);
-    }
-}
index 73a3312..b9500fb 100644 (file)
@@ -1,4 +1,4 @@
-{namespace s = TYPO3\CMS\Scheduler\ViewHelpers}
+<html xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers" data-namespace-typo3-fluid="true">
 
 <p class="lead">
        <f:translate key="msg.infoScreenIntro" />
@@ -22,7 +22,7 @@
                        <f:for each="{registeredClasses}" key="class" as="classInfo">
                                <tr>
                                        <td>
-                                               <a href="{s:moduleLink(controller:'scheduler', action: 'add', arguments: '{class: class}')}" title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:new')}">
+                                               <a href="{be:moduleLink(route: 'system_txschedulerM1', query: 'SET[function]=scheduler&CMD=add&tx_scheduler[class]={class}')}" title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:new')}">
                                                        {classInfo.title}
                                                </a>
                                        </td>
@@ -31,7 +31,7 @@
                                        <td>
                                                <div class="btn-group" role="group">
                                                        <span class="btn btn-default">
-                                                               <a href="{s:moduleLink(controller:'scheduler', action: 'add', arguments: '{class: class}')}" title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:new')}">
+                                                               <a href="{be:moduleLink(route: 'system_txschedulerM1', query: 'SET[function]=scheduler&CMD=add&tx_scheduler[class]={class}')}" title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:new')}">
                                                                        <core:icon identifier="actions-add" />
                                                                </a>
                                                        </span>
@@ -42,3 +42,4 @@
                </tbody>
        </table>
 </div>
+</html>
\ No newline at end of file