class helper

Properties

protected auth $auth
protected helper $avatar_helper
protected service $cache
protected config $config
protected language $language
protected dispatcher_interface $dispatcher
protected path_helper $path_helper
protected user $user
protected string $phpbb_root_path
protected array $name_strings

Methods

__construct(auth $auth, helper $avatar_helper, service $cache, config $config, language $language, dispatcher_interface $dispatcher, path_helper $path_helper, user $user)

Constructor

string
get_name(string $group_name)

No description

string
get_name_string(string $mode, int $group_id, string $group_name, string $group_colour = '', mixed $custom_profile_url = false)

Get group name details for placing into templates.

array
get_rank(array $group_data)

Get group rank title and image

array
get_avatar(array $group_row, string $alt = 'GROUP_AVATAR', bool $ignore_config = false, bool $lazy = false)

Get group avatar.

Details

at line 69
__construct(auth $auth, helper $avatar_helper, service $cache, config $config, language $language, dispatcher_interface $dispatcher, path_helper $path_helper, user $user)

Constructor

Parameters

auth $auth

Authentication object

helper $avatar_helper

Avatar helper object

service $cache

Cache service object

config $config

Configuration object

language $language

Language object

dispatcher_interface $dispatcher

Event dispatcher object

path_helper $path_helper

Path helper object

user $user

User object

at line 97
string get_name(string $group_name)

No description

Parameters

string $group_name

The stored group name

Return Value

string

Group name or translated group name if it exists

at line 119
string get_name_string(string $mode, int $group_id, string $group_name, string $group_colour = '', mixed $custom_profile_url = false)

Get group name details for placing into templates.

Parameters

string $mode

Profile (for getting an url to the profile), group_name (for obtaining the group name), colour (for obtaining the group colour), full (for obtaining a coloured group name link to the group's profile), no_profile (the same as full but forcing no profile link)

int $group_id

The group id

string $group_name

The group name

string $group_colour

The group colour

mixed $custom_profile_url

optional parameter to specify a profile url. The group id gets appended to this url as &g={group_id}

Return Value

string

A string consisting of what is wanted based on $mode.

at line 230
array get_rank(array $group_data)

Get group rank title and image

Parameters

array $group_data

The current stored group data

Return Value

array

An associative array containing the rank title (title), the rank image as full img tag (img) and the rank image source (img_src)

at line 296
array get_avatar(array $group_row, string $alt = 'GROUP_AVATAR', bool $ignore_config = false, bool $lazy = false)

Get group avatar.

Wrapper function for \phpbb\avatar\helper::get_group_avatar()

Parameters

array $group_row

Row from the groups table

string $alt

Optional language string for alt tag within image, can be a language key or text

bool $ignore_config

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

bool $lazy

If true, will be lazy loaded (requires JS)

Return Value

array

Avatar data