20 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
21 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
22 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
64 use CompileWithRenderStatic;
78 $this->registerArgument(
'backendUser',
'int',
'uid of the backend user',
false, 0);
79 $this->registerArgument(
'size',
'int',
'width and height of the image',
false, 32);
80 $this->registerArgument(
'showIcon',
'bool',
'show the record icon as well',
false,
false);
91 public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
93 if ($arguments[
'backendUser'] > 0) {
94 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(
'be_users');
95 $queryBuilder->getRestrictions()->removeAll();
96 $backendUser = $queryBuilder
100 $queryBuilder->expr()->eq(
102 $queryBuilder->createNamedParameter($arguments[
'backendUser'], \PDO::PARAM_INT)
108 $backendUser =
$GLOBALS[
'BE_USER']->user;
110 if ($backendUser ===
false) {
114 $avatar = GeneralUtility::makeInstance(Avatar::class);
115 return $avatar->render($backendUser, $arguments[
'size'], $arguments[
'showIcon']);