aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/classes/Avatar.php10
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 '