diff options
| author | Murtaza Sultani <sultani@data-quest.de> | 2025-10-23 16:52:34 +0200 |
|---|---|---|
| committer | Murtaza Sultani <sultani@data-quest.de> | 2025-10-23 16:52:57 +0200 |
| commit | 7392526a5c87a2a3853ccb0b0cb9631d4d8ab5dc (patch) | |
| tree | 1bcb73235e7ade480a6fb2afe1d80a852d42885a /lib | |
| parent | 8f6a427babce4474c95e1ef2424a89d5f5f12ddf (diff) | |
Update getAvatarDropdownHTML APIissue-5983
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/classes/Avatar.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/classes/Avatar.php b/lib/classes/Avatar.php index 28b0ce5..f018104 100644 --- a/lib/classes/Avatar.php +++ b/lib/classes/Avatar.php @@ -638,20 +638,18 @@ class Avatar return $this->user_id; } - public static function getAvatarDropdownHTML(User $user, bool $with_name = false): string + public static function getAvatarDropdownHTML(array $user, bool $with_name = true): string { $attributes = [ ':user' => json_encode([ - 'id' => $user->id, - 'name' => $user->getFullName(), - 'username' => $user->username, - 'avatar_url' => self::getAvatar($user->id)->getURL(self::MEDIUM) + ...$user, + 'avatar_url' => self::getAvatar($user['id'])->getURL(self::MEDIUM) ]) ]; $user_profile_link = ''; if ($with_name) { - $user_profile_link = '<a href="' . URLHelper::getLink('dispatch.php/profile', ['username' => $user->username]) . '">' . htmlReady($user->getFullName()) . '</a>'; + $user_profile_link = '<a href="' . URLHelper::getLink('dispatch.php/profile', ['username' => $user['username']]) . '">' . htmlReady($user['name']) . '</a>'; } return ' |
