class helper

Avatar helper object.

Generates avatars and their variables for display.

Properties

protected config $config
protected dispatcher $dispatcher
protected language $language
protected manager $manager
protected path_helper $path_helper
protected user $user

Methods

__construct(config $config, dispatcher $dispatcher, language $language, manager $manager, path_helper $path_helper, user $user)

Constructor.

array
get_template_vars(array $avatar, string $prefix = '')

Get an avatar's template variables.

array
get_user_avatar(array $row, string $title = 'USER_AVATAR', bool $ignore_config = false, bool $lazy = false)

Get user avatar data.

array
get_group_avatar(array $row, string $title = 'GROUP_AVATAR', bool $ignore_config = false, bool $lazy = false)

Get group avatar data.

array
get_avatar(array $row, string $title, bool $ignore_config = false, bool $lazy = false)

Get avatar data.

string
get_no_avatar_source()

Get the "no avatar" source string.

Details

at line 58
__construct(config $config, dispatcher $dispatcher, language $language, manager $manager, path_helper $path_helper, user $user)

Constructor.

Parameters

config $config

Config object

dispatcher $dispatcher

Event dispatcher object

language $language

Language object

manager $manager

Avatar manager object

path_helper $path_helper

Path helper object

user $user

User object

at line 82
array get_template_vars(array $avatar, string $prefix = '')

Get an avatar's template variables.

Parameters

array $avatar

The avatar's data

string $prefix

The variables' prefix

Return Value

array

The avatar's template variables

at line 110
array get_user_avatar(array $row, string $title = 'USER_AVATAR', bool $ignore_config = false, bool $lazy = false)

Get user avatar data.

Parameters

array $row

The user's table row

string $title

Optional language string/key for the title

bool $ignore_config

Ignores the config setting, to still be able to view the avatar in the UCP

bool $lazy

Indicator whether the avatar should be lazy loaded (requires JS) or not

Return Value

array

The avatar data array

at line 126
array get_group_avatar(array $row, string $title = 'GROUP_AVATAR', bool $ignore_config = false, bool $lazy = false)

Get group avatar data.

Parameters

array $row

The group's table row

string $title

Optional language string/key for the title

bool $ignore_config

Ignores the config setting, to still be able to view the avatar in the UCP

bool $lazy

Indicator whether the avatar should be lazy loaded (requires JS) or not

Return Value

array

The avatar data array

at line 142
array get_avatar(array $row, string $title, bool $ignore_config = false, bool $lazy = false)

Get avatar data.

Parameters

array $row

The cleaned table row

string $title

Optional language string/key for the title

bool $ignore_config

Ignores the config setting, to still be able to view the avatar in the UCP

bool $lazy

Indicator whether the avatar should be lazy loaded (requires JS) or not

Return Value

array

The avatar data array

at line 228
string get_no_avatar_source()

Get the "no avatar" source string.

Return Value

string

The "no avatar" source string