[TASK] Deprecate Be\Buttons\IconViewHelper 26/43026/9
authorFrank Nägler <frank.naegler@typo3.org>
Fri, 4 Sep 2015 13:52:25 +0000 (15:52 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sun, 20 Sep 2015 19:00:05 +0000 (21:00 +0200)
Resolves: #69535
Releases: master
Change-Id: I9563806cf0b80f07a6ff125a1f93351980c47f34
Reviewed-on: http://review.typo3.org/43026
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Classes/Imaging/IconRegistry.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-69535-DeprecateTYPO3CMSFluidViewHelpersBeButtonsIconViewHelper.rst [new file with mode: 0644]
typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/IconViewHelper.php
typo3/sysext/recycler/Resources/Private/Partials/RecordsTable/DeletedRecord.html

index b25fbff..3d39c7d 100644 (file)
@@ -342,6 +342,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                ),
 
                // Action Icons
+               'apps-pagetree-collapse' => array(
+                       'provider' => FontawesomeIconProvider::class,
+                       'options' => array(
+                               'name' => 'caret-right',
+                       )
+               ),
                'actions-document-close' => array(
                        'provider' => FontawesomeIconProvider::class,
                        'options' => array(
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-69535-DeprecateTYPO3CMSFluidViewHelpersBeButtonsIconViewHelper.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-69535-DeprecateTYPO3CMSFluidViewHelpersBeButtonsIconViewHelper.rst
new file mode 100644 (file)
index 0000000..72afa3e
--- /dev/null
@@ -0,0 +1,29 @@
+======================================================================================
+Deprecation: #69535 - Deprecate \TYPO3\CMS\Fluid\ViewHelpers\Be\Buttons\IconViewHelper
+======================================================================================
+
+
+Description
+===========
+
+``\TYPO3\CMS\Fluid\ViewHelpers\Be\Buttons\IconViewHelper`` has been deprecated.
+
+
+Impact
+======
+
+The viewhelper should not be used any longer and will be removed with TYPO3 CMS 8.
+
+
+Affected Installations
+======================
+
+Extensions which use the viewhelper.
+
+
+Migration
+=========
+
+Use the core icon viewhelper ``\TYPO3\CMS\Core\ViewHelpers\IconViewHelper`` instead.
+
+Example: Instead of ``<f:be.buttons.icon icon="apps-pagetree-collapse" />`` use ``<core:icon identifier="apps-pagetree-collapse" />``
index 2ced2b1..a77a09b 100644 (file)
@@ -21,7 +21,9 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Buttons;
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
 
-use TYPO3\CMS\Backend\Utility\IconUtility;
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
 use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
@@ -49,6 +51,7 @@ use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
  * <output>
  * Here the "actions-document-new" icon is returned, but without link.
  * </output>
+ * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use \TYPO3\CMS\Core\ViewHelpers\IconViewHelper instead
  */
 class IconViewHelper extends AbstractBackendViewHelper implements CompilableInterface {
 
@@ -64,6 +67,7 @@ class IconViewHelper extends AbstractBackendViewHelper implements CompilableInte
         * @param array $additionalAttributes Additional tag attributes. They will be added directly to the resulting HTML tag.
         *
         * @return string The rendered icon with or without link
+        * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use \TYPO3\CMS\Core\ViewHelpers\IconViewHelper instead
         */
        public function render($uri = '', $icon = 'actions-document-close', $title = '', $additionalAttributes = array()) {
                return static::renderStatic(
@@ -83,14 +87,17 @@ class IconViewHelper extends AbstractBackendViewHelper implements CompilableInte
         * @param callable $renderChildrenClosure
         * @param RenderingContextInterface $renderingContext
         * @return string
+        * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use \TYPO3\CMS\Core\ViewHelpers\IconViewHelper instead
         */
        static public function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) {
+               GeneralUtility::logDeprecatedFunction();
                $uri = $arguments['uri'];
                $icon = $arguments['icon'];
                $title = $arguments['title'];
                $additionalAttributes = $arguments['additionalAttributes'];
                $additionalTagAttributes = '';
-               $icon = IconUtility::getSpriteIcon($icon, array('title' => $title));
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+               $icon = '<span title="' . htmlspecialchars($title) . '">' . $iconFactory->getIcon($icon, Icon::SIZE_SMALL) . '</span>';
                if (empty($uri)) {
                        return $icon;
                }
index a58fa0f..00b659d 100644 (file)
@@ -7,8 +7,8 @@
        <td nowrap="nowrap">{record.pageTitle} ({record.pid})</td>
        <td nowrap="nowrap" class="text-right">
                <div class="btn-group">
-                       <a class="btn btn-default" data-action="expand" data-toggle="collapse" data-target="#{record.table}_{record.uid}">
-                               <f:be.buttons.icon icon="apps-pagetree-collapse" title="{f:translate(key: 'LLL:EXT:recycler/Resources/Private/Language/locallang.xlf:button.expand')}" />
+                       <a class="btn btn-default" data-action="expand" data-toggle="collapse" data-target="#{record.table}_{record.uid}" title="{f:translate(key: 'LLL:EXT:recycler/Resources/Private/Language/locallang.xlf:button.expand')}">
+                               <core:icon identifier="apps-pagetree-collapse" />
                        </a>
                        <a class="btn btn-default" data-action="undo" title="{f:translate(key: 'LLL:EXT:recycler/Resources/Private/Language/locallang.xlf:button.undo')}">
                                <core:icon identifier="actions-edit-undo" />
@@ -46,4 +46,4 @@
                        </tbody>
                </table>
        </td>
-</tr>
+</tr>
\ No newline at end of file