[TASK] Replace icon "status-status-permission-denied" with the new IconFactory 25/43225/5
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Sat, 12 Sep 2015 08:05:05 +0000 (10:05 +0200)
committerNicole Cordes <typo3@cordes.co>
Sat, 12 Sep 2015 11:35:06 +0000 (13:35 +0200)
Replaces all IconUtility::getSpriteIcon calls for the icon
status-status-permission-denied with the new IconFactory.

Resolves: #69692
Releases: master
Change-Id: I9c3d2565c89856961814b52d91931250afdef22f
Reviewed-on: http://review.typo3.org/43225
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/beuser/Classes/Controller/PermissionAjaxController.php
typo3/sysext/beuser/Classes/ViewHelpers/PermissionsViewHelper.php

index 180034e..a2c9cac 100644 (file)
@@ -304,25 +304,25 @@ class PermissionAjaxController {
                        if ($int & $permission) {
                                $str .= '<span title="' . $GLOBALS['LANG']->getLL($permission, TRUE)
                                        . ' class="change-permission text-success"'
-                                       . ' data-page="' . $pageId . '"'
-                                       . ' data-permissions="' . $int . '"'
+                                       . ' data-page="' . (int)$pageId . '"'
+                                       . ' data-permissions="' . (int)$int . '"'
                                        . ' data-mode="delete"'
-                                       . ' data-who="' . $who . '"'
+                                       . ' data-who="' . htmlspecialchars($who) . '"'
                                        . ' data-bits="' . $permission . '"'
                                        . ' style="cursor:pointer">'
                                        . $iconFactory->getIcon('status-status-permission-granted', Icon::SIZE_SMALL)
                                        . '</span>';
                        } else {
-                               $str .= IconUtility::getSpriteIcon('status-status-permission-denied', array(
-                                       'title' => $GLOBALS['LANG']->getLL($permission, TRUE),
-                                       'class' => 'change-permission text-danger',
-                                       'data-page' => $pageId,
-                                       'data-permissions' => $int,
-                                       'data-mode' => 'add',
-                                       'data-who' => $who,
-                                       'data-bits' => $permission,
-                                       'style' => 'cursor:pointer'
-                               ));
+                               $str .= '<span title="' . $GLOBALS['LANG']->getLL($permission, TRUE) . '"'
+                                       . ' class="change-permission text-danger"'
+                                       . ' data-page="' . (int)$pageId . '"'
+                                       . ' data-permissions="' . (int)$int . '"'
+                                       . ' data-mode="add"'
+                                       . ' data-who="' . htmlspecialchars($who) . '"'
+                                       . ' data-bits="' . $permission . '"'
+                                       . ' style="cursor:pointer">'
+                                       . $iconFactory->getIcon('status-status-permission-denied', Icon::SIZE_SMALL)
+                                       . '</span>';
                        }
                }
                return '<span id="' . $pageId . '_' . $who . '">' . $str . '</span>';
index 0708a89..ee24625 100644 (file)
@@ -15,6 +15,8 @@ namespace TYPO3\CMS\Beuser\ViewHelpers;
  */
 
 use TYPO3\CMS\Backend\Utility\IconUtility;
+use TYPO3\CMS\Core\Imaging\IconFactory;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
@@ -67,11 +69,13 @@ class PermissionsViewHelper extends AbstractViewHelper implements CompilableInte
        static public function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) {
                // The two main icon classes are static during one call. They trigger relatively expensive
                // calculation with a signal and object creation and thus make sense to have them cached.
+               /** @var IconFactory $iconFactory */
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                if (!static::$grantedCssClasses) {
                        static::$grantedCssClasses = IconUtility::getSpriteIconClasses('status-status-permission-granted');
                }
                if (!static::$deniedCssClasses) {
-                       static::$deniedCssClasses = IconUtility::getSpriteIconClasses('status-status-permission-denied');
+                       static::$deniedCssClasses = $iconFactory->getIcon('status-status-permission-denied')->render();
                }
 
                $masks = array(1, 16, 2, 4, 8);