[TASK] Replace icon by IconFactory: actions-system-backend-user-switch 11/43211/2
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 11 Sep 2015 17:32:05 +0000 (19:32 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 12 Sep 2015 09:53:56 +0000 (11:53 +0200)
Resolves: #69672
Releases: master
Change-Id: I32d97d57d0abdaa6214a0edda2e034c35cbd3906
Reviewed-on: http://review.typo3.org/43211
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/beuser/Classes/ViewHelpers/SwitchUserViewHelper.php
typo3/sysext/core/Classes/Imaging/IconRegistry.php

index 9f6ef3a..15a3140 100644 (file)
@@ -54,16 +54,15 @@ class SwitchUserViewHelper extends AbstractViewHelper implements CompilableInter
         */
        static public function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) {
                $backendUser = $arguments['backendUser'];
-
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                if ($backendUser->getUid() == $GLOBALS['BE_USER']->user['uid'] || !$backendUser->isActive()) {
-                       $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                        return '<span class="btn btn-default disabled">' . $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL)->render() . '</span>';
                }
                $title = LocalizationUtility::translate('switchBackMode', 'beuser');
                return '<a class="btn btn-default" href="' .
                        htmlspecialchars(GeneralUtility::linkThisScript(array('SwitchUser' => $backendUser->getUid()))) .
                        '" target="_top" title="' . htmlspecialchars($title) . '">' .
-                       IconUtility::getSpriteIcon(('actions-system-backend-user-switch')) . '</a>';
+                       $iconFactory->getIcon('actions-system-backend-user-switch', Icon::SIZE_SMALL)->render() . '</a>';
        }
 
 }
index 7148a01..1a7ce49 100644 (file)
@@ -472,6 +472,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-search.svg',
                        )
                ),
+               'actions-system-backend-user-switch'  => array(
+                       'provider' => FontawesomeIconProvider::class,
+                       'options' => array(
+                               'name' => 'sign-out',
+                       )
+               ),
                'actions-system-cache-clear-impact-low' => array(
                        'provider' => SvgIconProvider::class,
                        'options' => array(