TYPO3  7.6
AvatarViewHelper.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Backend\ViewHelpers;
3 
22 
27 {
36  public function render($backendUser = 0, $size = 32, $showIcon = false)
37  {
38  return static::renderStatic(
39  array(
40  'backendUser' => $backendUser,
41  'size' => $size,
42  'showIcon' => $showIcon
43  ),
45  $this->renderingContext
46  );
47  }
48 
58  {
59  if ($arguments['backendUser'] > 0) {
60  $backendUser = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'be_users', 'uid=' . (int)$arguments['backendUser']);
61  } else {
62  $backendUser = $GLOBALS['BE_USER']->user;
63  }
65  $avatar = GeneralUtility::makeInstance(Avatar::class);
66  return $avatar->render($backendUser, $arguments['size'], $arguments['showIcon']);
67  }
68 }