Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
intranetuserfieldassembler.php
1
<?php
2
3
namespace
Bitrix\Iblock\Grid\Row\Assembler
;
4
5
use
Bitrix\Main\Grid\Row\Assembler\Field\UserFieldAssembler
;
6
10
final
class
IntranetUserFieldAssembler
extends
UserFieldAssembler
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
}
Bitrix\Iblock\Grid\Row\Assembler\IntranetUserFieldAssembler
Definition
intranetuserfieldassembler.php:11
Bitrix\Iblock\Grid\Row\Assembler\IntranetUserFieldAssembler\loadUserName
loadUserName(int $userId)
Definition
intranetuserfieldassembler.php:26
Bitrix\Iblock\Grid\Row\Assembler\IntranetUserFieldAssembler\__construct
__construct(array $columnIds, string $profilePathTemplate)
Definition
intranetuserfieldassembler.php:14
Bitrix\Main\Grid\Row\Assembler\Field\UserFieldAssembler
Definition
userfieldassembler.php:14
Bitrix\Iblock\Grid\Row\Assembler
Definition
elementcountfieldassembler.php:3
modules
iblock
lib
grid
row
assembler
intranetuserfieldassembler.php
Создано системой
1.10.0