1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
user.php
См. документацию.
1
<?php
2
namespace
Bitrix\Socialnetwork\Livefeed\RenderParts;
3
4
use Bitrix\Main\Localization\Loc;
5
use Bitrix\Main\Config\Option;
6
use Bitrix\Main\ModuleManager;
7
8
Loc::loadMessages(__FILE__);
9
10
final
class
User
extends
Base
11
{
12
public
function
getData
(
$entityId
= 0)
13
{
14
static
$userPath =
null
;
15
static
$userNameTemplate =
null
;
16
static
$intranetInstalled =
null
;
17
static
$extranetInstalled =
null
;
18
19
$result
= $this->
getMetaResult
();
20
$options
= $this->
getOptions
();
21
22
if
($intranetInstalled ===
null
)
23
{
24
$intranetInstalled = ModuleManager::isModuleInstalled(
"intranet"
);
25
}
26
27
if
($extranetInstalled ===
null
)
28
{
29
$extranetInstalled = ($intranetInstalled && ModuleManager::isModuleInstalled(
"extranet"
));
30
}
31
32
$extranetSite = (
33
isset(
$options
[
'extranetSite'
])
34
?
$options
[
'extranetSite'
]
35
:
false
36
);
37
38
if
(intval(
$entityId
) == 0)
39
{
40
$result
[
'name'
] = (
41
$intranetInstalled
42
? Loc::getMessage(
"SONET_LIVEFEED_RENDERPARTS_USER_ALL"
)
43
: Loc::getMessage(
"SONET_LIVEFEED_RENDERPARTS_USER_ALL_BUS"
)
44
);
45
46
if
(
47
(!isset(
$options
[
'mobile'
]) || !
$options
[
'mobile'
])
48
&& (!isset(
$options
[
'im'
]) || !
$options
[
'im'
])
49
&& ($extranetSite !=
SITE_ID
)
50
&& defined(
"BITRIX24_PATH_COMPANY_STRUCTURE_VISUAL"
)
51
)
52
{
53
$result
[
'link'
] = BITRIX24_PATH_COMPANY_STRUCTURE_VISUAL;
54
}
55
}
56
elseif
(
57
(
$res
= \CUser::getByID(
$entityId
))
58
&& (
$fields
=
$res
->fetch())
59
)
60
{
61
$result
[
'id'
] =
$entityId
;
62
63
if
($userNameTemplate ===
null
)
64
{
65
$userNameTemplate = \CSite::getNameFormat();
66
}
67
68
$result
[
'name'
] = \CUser::formatName($userNameTemplate,
$fields
,
true
,
false
);
69
$result
[
'type'
] =
''
;
70
if
(
$fields
[
'EXTERNAL_AUTH_ID'
] ==
'email'
)
71
{
72
$result
[
'type'
] =
'email'
;
73
}
74
elseif
(
75
$extranetInstalled
76
&& isset(
$fields
[
'UF_DEPARTMENT'
])
77
&& empty(
$fields
[
'UF_DEPARTMENT'
])
78
)
79
{
80
$result
[
'type'
] =
'extranet'
;
81
}
82
83
if
(
84
empty(
$options
[
'skipLink'
])
85
|| !
$options
[
'skipLink'
]
86
)
87
{
88
if
($userPath ===
null
)
89
{
90
$userPath = (
91
(!isset(
$options
[
'im'
]) || !
$options
[
'im'
])
92
? (
93
(!isset(
$options
[
'mobile'
]) || !
$options
[
'mobile'
])
94
? Option::get(
'socialnetwork'
,
'user_page'
,
SITE_DIR
.
'company/personal/'
).
'user/#user_id#/'
95
:
SITE_DIR
.
'mobile/users/?user_id=#user_id#'
96
)
97
:
''
98
);
99
}
100
if
(!empty($userPath))
101
{
102
$result
[
'link'
] =
\CComponentEngine::makePathFromTemplate
(
103
$userPath,
104
array
(
105
"user_id"
=>
$entityId
106
)
107
);
108
}
109
}
110
}
111
112
return
$result
;
113
}
114
}
Bitrix\Socialnetwork\Livefeed\RenderParts\Base
Определения
base.php:5
Bitrix\Socialnetwork\Livefeed\RenderParts\Base\$options
$options
Определения
base.php:6
Bitrix\Socialnetwork\Livefeed\RenderParts\Base\getOptions
getOptions()
Определения
base.php:13
Bitrix\Socialnetwork\Livefeed\RenderParts\Base\getMetaResult
getMetaResult()
Определения
base.php:18
Bitrix\Socialnetwork\Livefeed\RenderParts\User
Определения
user.php:11
Bitrix\Socialnetwork\Livefeed\RenderParts\User\getData
getData($entityId=0)
Определения
user.php:12
CComponentEngine\makePathFromTemplate
static makePathFromTemplate($template, $arParams=array())
Определения
component_engine.php:355
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$res
$res
Определения
filter_act.php:7
$result
$result
Определения
get_property_values.php:14
SITE_DIR
const SITE_DIR(!defined('LANG'))
Определения
include.php:72
$entityId
$entityId
Определения
payment.php:4
false
return false
Определения
prolog_main_admin.php:185
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
SITE_ID
const SITE_ID
Определения
sonet_set_content_view.php:12
$fields
$fields
Определения
yandex_run.php:501
bitrix
modules
socialnetwork
lib
livefeed
renderparts
user.php
Создано системой
1.14.0