1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
user.php
См. документацию.
1<?php
2namespace Bitrix\Im\Integration\UI\EntitySelector\Helper;
3
4use Bitrix\Main\EO_User;
5
6class User
7{
8 public static function formatName(EO_User $user, array $options = []): string
9 {
10 return \CUser::formatName(
11 !empty($options['nameTemplate'])
12 ? $options['nameTemplate']
13 : \CSite::getNameFormat(false),
14 [
15 'NAME' => $user->getName(),
16 'LAST_NAME' => $user->getLastName(),
17 'SECOND_NAME' => $user->getSecondName(),
18 'LOGIN' => $user['LOGIN'],
19 'EMAIL' => $user['EMAIL'],
20 'TITLE' => $user['TITLE'],
21 ],
22 true,
23 false
24 );
25 }
26
27 public static function makeAvatar(EO_User $user): ?string
28 {
29 if (empty($user->getPersonalPhoto()))
30 {
31 return null;
32 }
33
34 $avatar = \CFile::resizeImageGet(
35 $user->getPersonalPhoto(),
36 ['width' => 100, 'height' => 100],
38 false
39 );
40
41 return !empty($avatar['src']) ? $avatar['src'] : null;
42 }
43
44 public static function getCurrentUserId(): int
45 {
46 return is_object($GLOBALS['USER']) ? (int)$GLOBALS['USER']->getId() : 0;
47 }
48}
static makeAvatar(EO_User $user)
Определения user.php:27
static formatName(EO_User $user, array $options=[])
Определения user.php:8
Определения orm.php:16144
$options
Определения commerceml2.php:49
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
const BX_RESIZE_IMAGE_EXACT
Определения constants.php:12
$user
Определения mysql_to_pgsql.php:33
$GLOBALS['____1690880296']
Определения license.php:1