Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
groups.php
1
<?
2
namespace
Bitrix\Socialnetwork\Integration\Main\UISelector
;
3
4
use
Bitrix\Main\Localization\Loc
;
5
use
Bitrix\Main\ModuleManager
;
6
7
class
Groups
extends
\Bitrix\Main\UI\Selector\EntityBase
8
{
9
public
function
getData
($params = array())
10
{
11
$result = array(
12
'ITEMS'
=> array(),
13
'ITEMS_LAST'
=> array(),
14
'ADDITIONAL_INFO'
=> array(
15
'SORT_SELECTED'
=> 100
16
)
17
);
18
19
$entityType =
Handler::ENTITY_TYPE_GROUPS
;
20
21
$options = (!empty($params[
'options'
]) ? $params[
'options'
] : array());
22
23
if
(
24
!empty($options[
'enableAll'
])
25
&& $options[
'enableAll'
] ==
'Y'
26
&& !
Handler::isExtranetUser
()
27
)
28
{
29
$allowToAllDestination = (
30
!isset($options[
'context'
])
31
|| !in_array($options[
'context'
], [
'BLOG_POST'
,
'FEED_FILTER_TO'
])
32
|| \Bitrix\Socialnetwork\ComponentHelper::getAllowToAllDestination()
33
);
34
if
($allowToAllDestination)
35
{
36
$result[
'ITEMS_LAST'
][] =
'UA'
;
37
}
38
39
$result[
'ITEMS'
][
'UA'
] = array(
40
'id'
=>
'UA'
,
41
'name'
=>
Loc::getMessage
(
42
ModuleManager::isModuleInstalled(
'intranet'
)
43
?
'MAIN_UI_SELECTOR_ITEM_TOALL_INTRANET'
44
:
'MAIN_UI_SELECTOR_ITEM_TOALL'
45
),
46
'searchable'
=> ($allowToAllDestination ?
'Y'
:
'N'
)
47
);
48
}
49
50
if
(
51
!empty($options[
'enableEmpty'
])
52
&& $options[
'enableEmpty'
] ==
'Y'
53
)
54
{
55
$result[
'ITEMS_LAST'
][] =
'EMPTY'
;
56
57
$result[
'ITEMS'
][
'EMPTY'
] = array(
58
'id'
=>
'EMPTY'
,
59
'name'
=>
Loc::getMessage
(
'MAIN_UI_SELECTOR_ITEM_EMPTY'
),
60
'searchable'
=>
'N'
61
);
62
}
63
64
if
(
65
!empty($options[
'enableUserManager'
])
66
&& $options[
'enableUserManager'
] ==
'Y'
67
)
68
{
69
$result[
'ITEMS_LAST'
][] =
'USER_MANAGER'
;
70
71
$result[
'ITEMS'
][
'USER_MANAGER'
] = array(
72
'id'
=>
'USER_MANAGER'
,
73
'name'
=>
Loc::getMessage
(
'MAIN_UI_SELECTOR_ITEM_USER_MANAGER'
),
74
'searchable'
=>
'N'
75
);
76
}
77
78
return
$result;
79
}
80
81
public
function
getItemName
($itemCode =
''
)
82
{
83
$result =
''
;
84
85
switch
($itemCode)
86
{
87
case
'EMPTY'
:
88
$result =
Loc::getMessage
(
'MAIN_UI_SELECTOR_ITEM_EMPTY'
);
89
break
;
90
case
'UA'
:
91
$result =
Loc::getMessage
(
92
ModuleManager::isModuleInstalled(
'intranet'
)
93
?
'MAIN_UI_SELECTOR_ITEM_TOALL_INTRANET'
94
:
'MAIN_UI_SELECTOR_ITEM_TOALL'
95
);
96
break
;
97
default
:
98
}
99
100
return
$result;
101
}
102
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ModuleManager
Definition
modulemanager.php:5
Bitrix\Main\UI\Selector\EntityBase
Definition
entitybase.php:13
Bitrix\Socialnetwork\Integration\Main\UISelector\Groups
Definition
groups.php:8
Bitrix\Socialnetwork\Integration\Main\UISelector\Groups\getData
getData($params=array())
Definition
groups.php:9
Bitrix\Socialnetwork\Integration\Main\UISelector\Groups\getItemName
getItemName($itemCode='')
Definition
groups.php:81
Bitrix\Socialnetwork\Integration\Main\UISelector\Handler\ENTITY_TYPE_GROUPS
const ENTITY_TYPE_GROUPS
Definition
handler.php:19
Bitrix\Socialnetwork\Integration\Main\UISelector\Handler\isExtranetUser
static isExtranetUser()
Definition
handler.php:26
Bitrix\Socialnetwork\Integration\Main\UISelector
Definition
crmemailusers.php:2
modules
socialnetwork
lib
integration
main
uiselector
groups.php
Создано системой
1.10.0