Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
userdatafilter.php
1<?php
3
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}
static getInstance($userId=null)
Definition user.php:44
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
$GLOBALS['____1444769544']
Definition license.php:1