-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.left.menu_ext_old.php
252 lines (235 loc) · 7.41 KB
/
.left.menu_ext_old.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
if (SITE_TEMPLATE_ID !== "bitrix24")
return;
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intranet/public/.left.menu_ext.php");
if (!CModule::IncludeModule("socialnetwork"))
return;
$arUserActiveFeatures = CSocNetFeatures::GetActiveFeatures(SONET_ENTITY_USER, $GLOBALS["USER"]->GetID());
GLOBAL $USER;
$USER_ID = $USER->GetID();
$aMenuB24 = array();
$aMenuB24[] = Array(
GetMessage("LEFT_MENU_LIVE_FEED"),
SITE_DIR."index.php",
Array(),
Array("name" => "live_feed", "counter_id" => "live-feed", "menu_item_id"=>"menu_live_feed"),
""
);
if ($GLOBALS["USER"]->IsAuthorized())
{
$arSocNetFeaturesSettings = CSocNetAllowed::GetAllowedFeatures();
if (CModule::IncludeModule("im") && SITE_TEMPLATE_ID == "bitrix24")
$aMenuB24[] = Array(
GetMessage("LEFT_MENU_IM_MESSENGER"),
"/online/",
Array(),
Array("counter_id" => "im-message", "menu_item_id"=>"menu_im_messenger"),
"CBXFeatures::IsFeatureEnabled('WebMessenger')"
);
if (
array_key_exists("tasks", $arSocNetFeaturesSettings)
&& array_key_exists("allowed", $arSocNetFeaturesSettings["tasks"])
&& in_array(SONET_ENTITY_USER, $arSocNetFeaturesSettings["tasks"]["allowed"])
&& in_array("tasks", $arUserActiveFeatures)
)
$aMenuB24[] = Array(
GetMessage("LEFT_MENU_TASKS"),
SITE_DIR."company/personal/user/".$USER_ID."/tasks/",
Array(),
Array("name" => "tasks", "counter_id" => "tasks_total", "menu_item_id" => "menu_tasks"),
"CBXFeatures::IsFeatureEnabled('Tasks')"
);
if (
array_key_exists("calendar", $arSocNetFeaturesSettings)
&& array_key_exists("allowed", $arSocNetFeaturesSettings["calendar"])
&& in_array(SONET_ENTITY_USER, $arSocNetFeaturesSettings["calendar"]["allowed"])
&& in_array("calendar", $arUserActiveFeatures)
)
$aMenuB24[] = Array(
GetMessage("LEFT_MENU_CALENDAR"),
SITE_DIR."company/personal/user/".$USER_ID."/calendar/",
Array(),
Array("menu_item_id"=>"menu_calendar", "counter_id" => "calendar"),
"CBXFeatures::IsFeatureEnabled('Calendar')"
);
if (
CModule::IncludeModule("disk") && $GLOBALS["USER"]->IsAuthorized()
&& array_key_exists("files", $arSocNetFeaturesSettings)
&& array_key_exists("allowed", $arSocNetFeaturesSettings["files"])
&& in_array(SONET_ENTITY_USER, $arSocNetFeaturesSettings["files"]["allowed"])
&& in_array("files", $arUserActiveFeatures)
)
$aMenuB24[] = Array(
GetMessage("LEFT_MENU_DISC"),
SITE_DIR."company/personal/user/".$USER_ID."/disk/path/",
Array(),
Array(),
"CBXFeatures::IsFeatureEnabled('PersonalFiles')"
);
if (
CModule::IncludeModule("photogallery")
&& array_key_exists("photo", $arSocNetFeaturesSettings)
&& array_key_exists("allowed", $arSocNetFeaturesSettings["photo"])
&& in_array(SONET_ENTITY_USER, $arSocNetFeaturesSettings["photo"]["allowed"])
&& in_array("photo", $arUserActiveFeatures)
)
$aMenuB24[] = Array(
GetMessage("LEFT_MENU_PHOTO"),
SITE_DIR."company/personal/user/".$USER_ID."/photo/",
Array(),
Array(),
"CBXFeatures::IsFeatureEnabled('PersonalPhoto')"
);
if (
CModule::IncludeModule("blog")
&& array_key_exists("blog", $arSocNetFeaturesSettings)
&& array_key_exists("allowed", $arSocNetFeaturesSettings["blog"])
&& in_array(SONET_ENTITY_USER, $arSocNetFeaturesSettings["blog"]["allowed"])
&& in_array("blog", $arUserActiveFeatures)
)
$aMenuB24[] = Array(
GetMessage("LEFT_MENU_BLOG"),
SITE_DIR."company/personal/user/".$USER_ID."/blog/",
Array(),
Array("counter_id" => "blog_post"),
""
);
if (CModule::IncludeModule("intranet") && CIntranetUtils::IsExternalMailAvailable())
$aMenuB24[] = Array(
GetMessage("LEFT_MENU_MAIL"),
SITE_DIR."company/personal/mail/",
Array(),
Array("counter_id" => "mail_unseen", "warning_link" => SITE_DIR.'company/personal/mail/?page=home', "warning_title" => GetMessage("LEFT_MENU_MAIL_SETTING"), "menu_item_id"=>"menu_external_mail"),
""
);
if (CModule::IncludeModule("bizproc"))
$aMenuB24[] = Array(
GetMessage("LEFT_MENU_BP"),
SITE_DIR."company/personal/bizproc/",
Array(),
Array("counter_id" => "bp_tasks"),
"CBXFeatures::IsFeatureEnabled('BizProc')"
);
if (IsModuleInstalled("lists") && COption::GetOptionString("lists", "turnProcessesOn") == "Y" && IsModuleInstalled("bizproc"))
$aMenuB24[] = Array(
GetMessage("LEFT_MENU_MY_PROCESS"),
SITE_DIR."company/personal/processes/",
Array(),
Array("menu_item_id"=>"menu_my_processes"),
""
);
if (CModule::IncludeModule("crm") && CCrmPerms::IsAccessEnabled())
$aMenuB24[] = Array(
GetMessage("LEFT_MENU_CRM"),
SITE_DIR."crm/stream/",
Array(),
Array("counter_id" => "crm_cur_act", "menu_item_id"=>"menu_crm_favorite"),
""
);
}
$arMenuB24[] = Array(
GetMessage("TOP_MENU_MARKETPLACE"),
SITE_DIR."marketplace/",
Array('/marketplace/'),
Array("class" => "menu-apps"),
(!IsModuleInstalled("rest")) ? "false" : "true"
);
if (CModule::IncludeModule("socialnetwork"))
$arMenuB24[] = Array(
GetMessage("TOP_MENU_GROUPS"),
SITE_DIR."workgroups/",
Array(),
Array("class" => "menu-groups"),
"CBXFeatures::IsFeatureEnabled('Workgroups')"
);
//extranet groups
if (CModule::IncludeModule("extranet") && CBXFeatures::IsFeatureEnabled('Workgroups') && CBXFeatures::IsFeatureEnabled('Extranet') && CModule::IncludeModule("socialnetwork"))
{
$arGroupFilterMy = array(
"USER_ID" => $USER_ID,
"<=ROLE" => SONET_ROLES_USER,
"GROUP_ACTIVE" => "Y",
"!GROUP_CLOSED" => "Y",
"GROUP_SITE_ID" => CExtranet::GetExtranetSiteID()
);
$dbGroups = CSocNetUserToGroup::GetList(
array(),
$arGroupFilterMy,
false,
array('nTopCount' => 1)
//array('ID')
);
if ($arGroups = $dbGroups->GetNext())
{
$arMenuB24[] = Array(
GetMessage("TOP_MENU_GROUPS_EXTRANET"),
SITE_DIR."workgroups/extranet/",
Array(),
Array("class" => "menu-groups-extranet"),
"CBXFeatures::IsFeatureEnabled('Workgroups')"
);
}
}
$arSkipPattern = array("\/workgroups\/$", "\/workgroups\/extranet\/$");
$arPathClassPattern = array(
"\/company\/$" => "menu-employees",
"\/docs\/$" => "menu-docs",
"\/services\/$" => "menu-services",
"\/crm\/$" => "menu-crm",
"\/about\/$" => "menu-company",
"\/marketplace\/$" => "menu-apps",
);
foreach ($aMenuLinks as $arItem)
{
$bFound = false;
foreach($arSkipPattern as $skip)
{
preg_match("/".$skip."/is", $arItem[1], $matches);
if ($matches[0])
{
$bFound = true;
break;
}
}
if ($bFound)
continue;
foreach ($arPathClassPattern as $path => $class)
{
$matches = "";
preg_match("/".$path."/is", $arItem[1], $matches);
if ($matches[0])
{
$arItem[3] = array("class" => $class);
break;
}
}
$arMenuB24[] = $arItem;
}
$arMenuB24[] = Array(
GetMessage('TOP_MENU_OPENLINES'),
SITE_DIR."services/openlines/",
Array('/services/openlines/'),
Array("class" => "menu-openlines"),
(!IsModuleInstalled("imopenlines"))?"false":'$GLOBALS["USER"]->IsAdmin()'
);
$arMenuB24[] = Array(
GetMessage("TOP_MENU_TELEPHONY"),
SITE_DIR."services/telephony/",
Array('/services/telephony/'),
Array("class" => "menu-telephony"),
'CModule::IncludeModule("voximplant") && Bitrix\Voximplant\Security\Helper::isMainMenuEnabled()'
);
$rsSite = CSite::GetList($by="sort", $order="asc", $arFilter=array("ACTIVE" => "Y"));
if (intval($rsSite->SelectedRowsCount())>1)
{
$arMenuB24[] = Array(
GetMessage("TOP_MENU_DEPARTMENTS"),
SITE_DIR."departments/",
Array(),
Array("class" => "menu-departments"),
""
);
}
$aMenuLinks = array_merge($aMenuLinks, $aMenuB24);
?>