[TASK] Remove unused ViewHelpers from extension manager 34/55734/6
authorGeorg Ringer <georg.ringer@gmail.com>
Thu, 15 Feb 2018 12:52:27 +0000 (13:52 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 19 Feb 2018 10:58:24 +0000 (11:58 +0100)
Several ViewHelpers inside the extension maanger are not used and
can be removed. As those are not public API no RST file or deprecation
is required.

Resolves: #83937
Releases: master
Change-Id: I0bb551e14062e805ef8b23559bcc22ae32a8e399
Reviewed-on: https://review.typo3.org/55734
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Tobi Kretschmann <tobi@tobishome.de>
Reviewed-by: Sascha Rademacher <sascha.rademacher+typo3@gmail.com>
Reviewed-by: Jan Stockfisch <jan.stockfisch@googlemail.com>
Tested-by: Jan Stockfisch <jan.stockfisch@googlemail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/extensionmanager/Classes/ViewHelpers/Format/ImplodeViewHelper.php [deleted file]
typo3/sysext/extensionmanager/Classes/ViewHelpers/Link/ActionViewHelper.php [deleted file]
typo3/sysext/extensionmanager/Classes/ViewHelpers/ReloadSqlDataViewHelper.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/RemoveExtensionViewHelper.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/ShowExtensionVersionsViewHelper.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/TimeSinceLastUpdateViewHelper.php [deleted file]
typo3/sysext/extensionmanager/Classes/ViewHelpers/ToggleExtensionInstallationStateViewHelper.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/UpdateScriptViewHelper.php

diff --git a/typo3/sysext/extensionmanager/Classes/ViewHelpers/Format/ImplodeViewHelper.php b/typo3/sysext/extensionmanager/Classes/ViewHelpers/Format/ImplodeViewHelper.php
deleted file mode 100644 (file)
index 1ffcee9..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extensionmanager\ViewHelpers\Format;
-
-/*
- * 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 TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
-
-/**
- * View Helper for imploding arrays
- * @internal
- */
-class ImplodeViewHelper extends AbstractViewHelper
-{
-    use CompileWithRenderStatic;
-
-    /**
-     * Initialize arguments of this view helper
-     */
-    public function initializeArguments()
-    {
-        $this->registerArgument('implode', 'array', '', true);
-        $this->registerArgument('delimiter', 'string', '', false, ', ');
-    }
-
-    /**
-     * Implodes a string
-     *
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     *
-     * @return string the altered string.
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        return implode($arguments['delimiter'], $arguments['implode']);
-    }
-}
diff --git a/typo3/sysext/extensionmanager/Classes/ViewHelpers/Link/ActionViewHelper.php b/typo3/sysext/extensionmanager/Classes/ViewHelpers/Link/ActionViewHelper.php
deleted file mode 100644 (file)
index 661d3cf..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extensionmanager\ViewHelpers\Link;
-
-/*
- * 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 TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
-
-/**
- * A view helper for creating links to extensionmanager actions
- *
- * @internal
- */
-class ActionViewHelper extends AbstractTagBasedViewHelper
-{
-    /**
-     * @var string
-     */
-    protected $tagName = 'a';
-
-    /**
-     * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-     */
-    protected $objectManager;
-
-    /**
-     * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
-     */
-    public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
-    {
-        $this->objectManager = $objectManager;
-    }
-
-    /**
-     * Arguments initialization
-     */
-    public function initializeArguments()
-    {
-        parent::initializeArguments();
-        $this->registerUniversalTagAttributes();
-        $this->registerTagAttribute('name', 'string', 'Specifies the name of an anchor');
-        $this->registerTagAttribute('rel', 'string', 'Specifies the relationship between the current document and the linked document');
-        $this->registerTagAttribute('rev', 'string', 'Specifies the relationship between the linked document and the current document');
-        $this->registerTagAttribute('target', 'string', 'Specifies where to open the linked document');
-    }
-}
index c22e8ee..279a7d1 100644 (file)
@@ -19,11 +19,12 @@ use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Registry;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
+use TYPO3\CMS\Fluid\ViewHelpers\Link\ActionViewHelper;
 
 /**
  * View helper for update script link
  */
-class ReloadSqlDataViewHelper extends Link\ActionViewHelper
+class ReloadSqlDataViewHelper extends ActionViewHelper
 {
     /**
      * @var string
index fda413b..fab045b 100644 (file)
@@ -17,12 +17,13 @@ namespace TYPO3\CMS\Extensionmanager\ViewHelpers;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Fluid\ViewHelpers\Link\ActionViewHelper;
 
 /**
  * view helper for displaying a remove extension link
  * @internal
  */
-class RemoveExtensionViewHelper extends Link\ActionViewHelper
+class RemoveExtensionViewHelper extends ActionViewHelper
 {
     /**
      * Initialize arguments
index 4d137a9..0e74579 100644 (file)
@@ -15,12 +15,13 @@ namespace TYPO3\CMS\Extensionmanager\ViewHelpers;
  */
 
 use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
+use TYPO3\CMS\Fluid\ViewHelpers\Link\ActionViewHelper;
 
 /**
  * Display a link to show all versions of an extension
  * @internal
  */
-class ShowExtensionVersionsViewHelper extends Link\ActionViewHelper
+class ShowExtensionVersionsViewHelper extends ActionViewHelper
 {
     /**
      * @var string
diff --git a/typo3/sysext/extensionmanager/Classes/ViewHelpers/TimeSinceLastUpdateViewHelper.php b/typo3/sysext/extensionmanager/Classes/ViewHelpers/TimeSinceLastUpdateViewHelper.php
deleted file mode 100644 (file)
index 0f07683..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extensionmanager\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 TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
-use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
-use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
-
-/**
- * Shows the elapsed time since the last update of the extension repository
- * from TER in a readable manner.
- *
- * @internal
- */
-class TimeSinceLastUpdateViewHelper extends AbstractViewHelper
-{
-    use CompileWithRenderStatic;
-
-    /**
-     * Initialize arguments
-     */
-    public function initializeArguments()
-    {
-        $this->registerArgument('lastUpdateTime', \DateTime::class, 'The date of the last update.', true);
-    }
-
-    /**
-     * Render method
-     *
-     * @param array $arguments
-     * @param \Closure $renderChildrenClosure
-     * @param RenderingContextInterface $renderingContext
-     *
-     * @return string
-     */
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
-    {
-        $lastUpdateTime = $arguments['lastUpdateTime'];
-        if (null === $lastUpdateTime) {
-            return $GLOBALS['LANG']->sL(
-                'LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:extensionList.updateFromTer.never'
-            );
-        }
-        return \TYPO3\CMS\Backend\Utility\BackendUtility::calcAge(
-            time() - $lastUpdateTime->format('U'),
-            $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.minutesHoursDaysYears')
-        );
-    }
-}
index 4fedb54..8407514 100644 (file)
@@ -19,18 +19,30 @@ use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Package\PackageManager;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
+use TYPO3\CMS\Fluid\ViewHelpers\Link\ActionViewHelper;
 
 /**
  * Display a deactivate / activate link
  * @internal
  */
-class ToggleExtensionInstallationStateViewHelper extends Link\ActionViewHelper
+class ToggleExtensionInstallationStateViewHelper extends ActionViewHelper
 {
     /**
      * @var string
      */
     protected $tagName = 'a';
 
+    /** @var \TYPO3\CMS\Extbase\Object\ObjectManager */
+    protected $objectManager;
+
+    /**
+     * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+     */
+    public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
+    {
+        $this->objectManager = $objectManager;
+    }
+
     /**
      * Initialize arguments
      */
index 1edb205..af10386 100644 (file)
@@ -17,13 +17,26 @@ namespace TYPO3\CMS\Extensionmanager\ViewHelpers;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Fluid\ViewHelpers\Link\ActionViewHelper;
 
 /**
  * View helper for update script link
  * @internal
  */
-class UpdateScriptViewHelper extends Link\ActionViewHelper
+class UpdateScriptViewHelper extends ActionViewHelper
 {
+
+    /** @var \TYPO3\CMS\Extbase\Object\ObjectManager */
+    protected $objectManager;
+
+    /**
+     * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+     */
+    public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
+    {
+        $this->objectManager = $objectManager;
+    }
+
     /**
      * initialize arguments
      */