TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Avatar Class Reference

Public Member Functions

 __construct ()
 
 render (array $backendUser=null, $size=32, $showIcon=false)
 
 getImgTag (array $backendUser=null, $size=32)
 
 getImage (array $backendUser, $size)
 

Protected Member Functions

 validateSortAndInitiateAvatarProviders ()
 
 getBackendUser ()
 

Protected Attributes

 $avatarProviders = []
 

Detailed Description

Avatar renderer class

Definition at line 25 of file Avatar.php.

Constructor & Destructor Documentation

__construct ( )

Construct

Definition at line 37 of file Avatar.php.

References Avatar\validateSortAndInitiateAvatarProviders().

Member Function Documentation

getBackendUser ( )
protected

Returns the current BE user.

Returns

Definition at line 148 of file Avatar.php.

References $GLOBALS.

Referenced by Avatar\getImgTag(), and Avatar\render().

getImage ( array  $backendUser,
  $size 
)

Get Image from first provider that returns one

Parameters
array$backendUserbe_users record
int$size
Returns
Image|NULL

Definition at line 100 of file Avatar.php.

Referenced by Avatar\getImgTag().

getImgTag ( array  $backendUser = null,
  $size = 32 
)

Get avatar img tag

Parameters
array$backendUserbe_users record
int$size
Returns
string

Definition at line 75 of file Avatar.php.

References Avatar\getBackendUser(), and Avatar\getImage().

Referenced by Avatar\render().

render ( array  $backendUser = null,
  $size = 32,
  $showIcon = false 
)

Render avatar tag

Parameters
array$backendUserbe_users record
int$sizewidth and height of the image
bool$showIconshow the record icon
Returns
string

Definition at line 50 of file Avatar.php.

References Avatar\getBackendUser(), Avatar\getImgTag(), GeneralUtility\makeInstance(), and Icon\SIZE_SMALL.

validateSortAndInitiateAvatarProviders ( )
protected

Validates the registered avatar providers

Returns
void
Exceptions
\RuntimeException

Definition at line 117 of file Avatar.php.

References $GLOBALS, and GeneralUtility\makeInstance().

Referenced by Avatar\__construct().

Member Data Documentation

$avatarProviders = []
protected

Definition at line 32 of file Avatar.php.