Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
sonetgroup.php
1
<?php
2
namespace
Bitrix\Socialnetwork\Livefeed\RenderParts
;
3
4
use
Bitrix\Main\Localization\Loc
;
5
use
Bitrix\Main\Config\Option
;
6
7
Loc::loadMessages
(__FILE__);
8
9
final
class
SonetGroup
extends
Base
10
{
11
public
function
getData
($entityId = 0)
12
{
13
static
$groupPath =
null
;
14
15
global $USER;
16
17
$result = $this->
getMetaResult
();
18
$options
= $this->
getOptions
();
19
20
if
($fields = \CSocNetGroup::getByID($entityId))
21
{
22
$result[
'id'
] = $entityId;
23
$result[
'name'
] = (
24
isset($fields[
"~NAME"
])
25
? $fields[
"~NAME"
]
26
:
''
27
);
28
29
if
(
30
empty(
$options
[
'skipLink'
])
31
|| !
$options
[
'skipLink'
]
32
)
33
{
34
if
($groupPath ===
null
)
35
{
36
$groupPath = (
37
(!isset(
$options
[
'mobile'
]) || !
$options
[
'mobile'
])
38
&& (!isset(
$options
[
'im'
]) || !
$options
[
'im'
])
39
? Option::get(
'socialnetwork'
,
'workgroups_page'
, SITE_DIR.
'company/workgroups/'
).
'group/#group_id#/'
40
:
''
41
);
42
}
43
44
if
(!empty($groupPath))
45
{
46
$extranet = (
47
isset(
$options
[
'extranet'
])
48
?
$options
[
'extranet'
]
49
: false
50
);
51
$extranetSite = (
52
isset(
$options
[
'extranetSite'
])
53
?
$options
[
'extranetSite'
]
54
: false
55
);
56
57
$link = \CComponentEngine::makePathFromTemplate(
58
$groupPath,
59
array(
60
"group_id"
=> $fields[
"ID"
]
61
)
62
);
63
64
$groupSiteID =
false
;
65
66
$res = \CSocNetGroup::getSite($fields[
"ID"
]);
67
while
($groupSiteList = $res->fetch())
68
{
69
if
(
70
!$groupSiteID
71
&& (
72
!$extranet
73
|| $groupSiteList[
"LID"
] != $extranetSite
74
)
75
)
76
{
77
$groupSiteID = $groupSiteList[
"LID"
];
78
}
79
}
80
81
if
($groupSiteID)
82
{
83
$tmp = \CSocNetLogTools::processPath(array(
"GROUP_URL"
=> $link), $USER->getId(), $groupSiteID);
84
$link = ($tmp[
"URLS"
][
"GROUP_URL"
] <>
''
? $tmp[
"SERVER_NAME"
].$tmp[
"URLS"
][
"GROUP_URL"
] : $link);
85
}
86
87
$result[
'link'
] = $link;
88
}
89
}
90
}
91
92
return
$result;
93
}
94
95
}
Bitrix\Main\Config\Option
Definition
option.php:15
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Socialnetwork\Livefeed\RenderParts\Base
Definition
base.php:5
Bitrix\Socialnetwork\Livefeed\RenderParts\Base\$options
$options
Definition
base.php:6
Bitrix\Socialnetwork\Livefeed\RenderParts\Base\getOptions
getOptions()
Definition
base.php:13
Bitrix\Socialnetwork\Livefeed\RenderParts\Base\getMetaResult
getMetaResult()
Definition
base.php:18
Bitrix\Socialnetwork\Livefeed\RenderParts\SonetGroup
Definition
sonetgroup.php:10
Bitrix\Socialnetwork\Livefeed\RenderParts\SonetGroup\getData
getData($entityId=0)
Definition
sonetgroup.php:11
Bitrix\Socialnetwork\Livefeed\RenderParts
Definition
base.php:2
modules
socialnetwork
lib
livefeed
renderparts
sonetgroup.php
Создано системой
1.10.0