1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
userdatafilter.php
См. документацию.
1<?php
2namespace Bitrix\Im\Integration\UI\EntitySelector;
3
4use Bitrix\Im\User;
5use Bitrix\Main\Localization\Loc;
6use Bitrix\UI\EntitySelector\BaseFilter;
7use Bitrix\UI\EntitySelector\Dialog;
8use Bitrix\UI\EntitySelector\Item;
9
11{
12 public function __construct()
13 {
14 parent::__construct();
15 }
16
17 public function isAvailable(): bool
18 {
19 return $GLOBALS['USER']->isAuthorized();
20 }
21
22 public function apply(array $items, Dialog $dialog): void
23 {
24 foreach ($items as $item)
25 {
26 if (!($item instanceof Item))
27 {
28 continue;
29 }
30
31 if ($item->getId() === Helper\User::getCurrentUserId())
32 {
33 $item->addBadges([[
34 'id' => 'IT_IS_YOU',
35 'title' => Loc::getMessage('IM_UI_ENTITY_SELECTOR_IT_IS_YOU'),
36 ]]);
37 }
38
39 $customData = $item->getCustomData();
40 $userInfo = User::getInstance($item->getId())->getArray();
41 $customData->set('imUser', $userInfo);
42
43 //TODO delete after immobile chatselector fix with revision 21c5a9948579
44 $defaultIcon = '';
45 if (!$item->getAvatar())
46 {
47 $item->setAvatar($defaultIcon);
48 }
49 }
50 }
51}
apply(array $items, Dialog $dialog)
Определения userdatafilter.php:22
static getInstance($userId=null)
Определения user.php:45
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$GLOBALS['____1690880296']
Определения license.php:1
$items
Определения template.php:224