registerArgument('permission', 'int', 'Current permission', true); $this->registerArgument('scope', 'string', '"user" / "group" / "everybody"', true); $this->registerArgument('pageId', 'int', '', true); } /** * Return permissions. * * @param array $arguments * @param \Closure $renderChildrenClosure * @param RenderingContextInterface $renderingContext * @return string * @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception */ public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) { $masks = [1, 16, 2, 4, 8]; if (empty(static::$permissionLabels)) { foreach ($masks as $mask) { static::$permissionLabels[$mask] = LocalizationUtility::translate( 'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:' . $mask, 'be_user' ); } } $icon = ''; foreach ($masks as $mask) { if ($arguments['permission'] & $mask) { $permissionClass = 'fa-check text-success'; $mode = 'delete'; } else { $permissionClass = 'fa-times text-danger'; $mode = 'add'; } $label = static::$permissionLabels[$mask]; $icon .= ''; } return '' . $icon . ''; } }