Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
intranetuserfieldassembler.php
1<?php
2
4
6
11{
12 private string $profilePathTemplate;
13
14 public function __construct(array $columnIds, string $profilePathTemplate)
15 {
16 parent::__construct($columnIds);
17
18 $this->profilePathTemplate = $profilePathTemplate;
19 }
20
21 private function getProfilePath(int $userId): string
22 {
23 return str_replace('#ID#', $userId, $this->profilePathTemplate);
24 }
25
26 protected function loadUserName(int $userId): string
27 {
28 $userName = parent::loadUserName($userId);
29 if (!empty($userName))
30 {
31 $userName = htmlspecialcharsbx($userName);
32 $profilePath = htmlspecialcharsbx($this->getProfilePath($userId));
33
34 return "<a href=\"{$profilePath}\" target='_blank' bx-tooltip-user-id='{$userId}'>{$userName}</a>";
35 }
36
37 return '';
38 }
39}