3use \Bitrix\Main\Localization\Loc;
4Loc::loadMessages(__FILE__);
5Loc::loadMessages(
$_SERVER[
'DOCUMENT_ROOT'].
BX_ROOT.
'/modules/main/options.php');
16 "TEXT"=>Loc::getMessage(
"IM_OPTIONS_CONVERT"),
17 "LINK"=>
"im_convert.php?lang=".LANGUAGE_ID,
18 "TITLE"=>Loc::getMessage(
"IM_OPTIONS_CONVERT_TITLE"),
27 'user_name_template' => CIMContactList::GetUserNameTemplate(
false,
false,
true)
31 $arDefaultValues[
'default'][
'path_to_user_profile'] =
'/club/user/#user_id#/';
35 'user_name_template' => CIMContactList::GetUserNameTemplate(
false,
false,
true)
38$dbSites = CSite::GetList(
'',
'', Array(
"ACTIVE" =>
"Y"));
53 "DIV" =>
"edit1",
"TAB" => Loc::getMessage(
"IM_TAB_SETTINGS"),
"ICON" =>
"im_path",
"TITLE" => Loc::getMessage(
"IM_TAB_TITLE_SETTINGS"),
60 if($_GET[
'RestoreDefaults'] <>
'')
62 COption::RemoveOption(
"im",
"view_offline");
63 COption::RemoveOption(
"im",
"view_group");
64 COption::RemoveOption(
"im",
"send_by_enter");
65 COption::RemoveOption(
"im",
"correct_text");
66 COption::RemoveOption(
"im",
"panel_position_horizontal");
67 COption::RemoveOption(
"im",
"panel_position_vertical");
68 COption::RemoveOption(
"im",
"load_last_message");
69 COption::RemoveOption(
"im",
"load_last_notify");
70 COption::RemoveOption(
"im",
"privacy_message");
71 COption::RemoveOption(
"im",
"privacy_chat");
72 COption::RemoveOption(
"im",
"privacy_call");
73 COption::RemoveOption(
"im",
"privacy_search");
74 COption::RemoveOption(
"im",
"privacy_profile");
76 COption::RemoveOption(
"im",
"color_enable");
77 COption::RemoveOption(
"im",
"open_chat_enable");
78 COption::RemoveOption(
"im",
"general_chat_message_join");
79 COption::RemoveOption(
"im",
"general_chat_message_leave");
80 COption::RemoveOption(
"im",
"chat_message_start");
81 COption::RemoveOption(
"im",
"contact_list_birthday");
86 foreach($arDefValues as
$key=>$value)
88 if (in_array(
$key, Array(
"user_name_template")))
89 COption::RemoveOption(
"im",
$key);
91 COption::SetOptionString(
"im",
$key, $value,
false,
$site[
"LID"]);
95 elseif($_POST[
'Update'] <>
'')
101 if (isset($_POST[
$key.
"_".
$site[
"LID"]]))
103 if (empty($_POST[
$key.
"_".
$site[
"LID"]]) && (
$key ==
"user_name_template"))
104 COption::RemoveOption(
"im",
"user_name_template",
$site[
"LID"]);
106 COption::SetOptionString(
"im",
$key, $_POST[
$key.
"_".
$site[
"LID"]],
false,
$site[
"LID"]);
111 if ($_POST[
'PANEL_LOCATION'] ==
'TL')
113 $_POST[
'PANEL_POSITION_VERTICAL'] =
'top';
114 $_POST[
'PANEL_POSITION_HORIZONTAL'] =
'left';
116 elseif ($_POST[
'PANEL_LOCATION'] ==
'TR')
118 $_POST[
'PANEL_POSITION_VERTICAL'] =
'top';
119 $_POST[
'PANEL_POSITION_HORIZONTAL'] =
'right';
121 elseif ($_POST[
'PANEL_LOCATION'] ==
'TC')
123 $_POST[
'PANEL_POSITION_VERTICAL'] =
'top';
124 $_POST[
'PANEL_POSITION_HORIZONTAL'] =
'center';
126 elseif ($_POST[
'PANEL_LOCATION'] ==
'BL')
128 $_POST[
'PANEL_POSITION_VERTICAL'] =
'bottom';
129 $_POST[
'PANEL_POSITION_HORIZONTAL'] =
'left';
131 elseif ($_POST[
'PANEL_LOCATION'] ==
'BR')
133 $_POST[
'PANEL_POSITION_VERTICAL'] =
'bottom';
134 $_POST[
'PANEL_POSITION_HORIZONTAL'] =
'right';
136 elseif ($_POST[
'PANEL_LOCATION'] ==
'BC')
138 $_POST[
'PANEL_POSITION_VERTICAL'] =
'bottom';
139 $_POST[
'PANEL_POSITION_HORIZONTAL'] =
'center';
142 $_POST[
'START_CHAT_MESSAGE'] = $_POST[
'START_CHAT_MESSAGE'] ==
'first'?
'first':
'last';
143 $_POST[
'COLOR_ENABLE'] = isset($_POST[
'COLOR_ENABLE']);
144 $_POST[
'OPEN_CHAT_ENABLE'] = isset($_POST[
'OPEN_CHAT_ENABLE']);
147 'viewOffline' => !isset($_POST[
'VIEW_OFFLINE']),
148 'viewGroup' => !isset($_POST[
'VIEW_GROUP']),
149 'sendByEnter' => $_POST[
'SEND_BY_ENTER'] ==
'Y',
150 'correctText' => $_POST[
'CORRECT_TEXT'] ==
'Y',
151 'panelPositionHorizontal' => $_POST[
'PANEL_POSITION_HORIZONTAL'],
152 'panelPositionVertical' => $_POST[
'PANEL_POSITION_VERTICAL'],
153 'loadLastNotify' => isset($_POST[
'LOAD_LAST_NOTIFY']),
154 'privacyMessage' => $_POST[
'PRIVACY_MESSAGE'],
155 'privacyChat' => $_POST[
'PRIVACY_CHAT'],
156 'privacyCall' => $_POST[
'PRIVACY_CALL'],
157 'privacySearch' => $_POST[
'PRIVACY_SEARCH'],
158 'privacyProfile' => $_POST[
'PRIVACY_PROFILE'],
161 if (in_array($_POST[
'CONTACT_LIST_BIRTHDAY'], [
'all',
'department',
'none'],
true))
163 COption::SetOptionString(
"im",
"contact_list_birthday", $_POST[
'CONTACT_LIST_BIRTHDAY']);
166 COption::SetOptionString(
"im",
"view_offline", $arSettings[
'viewOffline']);
167 COption::SetOptionString(
"im",
"view_group", $arSettings[
'viewGroup']);
168 COption::SetOptionString(
"im",
"send_by_enter", $arSettings[
'sendByEnter']);
169 COption::SetOptionString(
"im",
"correct_text", $arSettings[
'correctText']);
170 COption::SetOptionString(
"im",
"panel_position_horizontal", $arSettings[
'panelPositionHorizontal']);
171 COption::SetOptionString(
"im",
"panel_position_vertical", $arSettings[
'panelPositionVertical']);
172 COption::SetOptionString(
"im",
"load_last_notify", $arSettings[
'loadLastNotify']);
173 COption::SetOptionString(
"im",
"privacy_message", $arSettings[
'privacyMessage']);
174 COption::SetOptionString(
"im",
"privacy_chat", $arSettings[
'privacyChat']);
175 COption::SetOptionString(
"im",
"privacy_call", $arSettings[
'privacyCall']);
176 COption::SetOptionString(
"im",
"privacy_search", $arSettings[
'privacySearch']);
177 COption::SetOptionString(
"im",
"privacy_profile", $arSettings[
'privacyProfile']);
178 COption::SetOptionString(
"im",
"start_chat_message", $_POST[
'START_CHAT_MESSAGE']);
179 COption::SetOptionString(
"im",
"color_enable", $_POST[
'COLOR_ENABLE']);
180 COption::SetOptionString(
"im",
"open_chat_enable", $_POST[
'OPEN_CHAT_ENABLE']);
184 COption::SetOptionString(
"im",
"contact_list_load", isset($_POST[
'CONTACT_LIST_LOAD']));
185 COption::SetOptionString(
"im",
"general_chat_message_join", isset($_POST[
'GENERAL_CHAT_MESSAGE_JOIN']));
186 COption::SetOptionString(
"im",
"general_chat_message_leave", isset($_POST[
'GENERAL_CHAT_MESSAGE_LEAVE']));
200<form method=
"post" action=
"<?echo $APPLICATION->GetCurPage()?>?mid=<?=htmlspecialcharsbx($mid)?>&lang=<?echo LANG?>">
207if ($arSettingsDefault[
'panelPositionVertical'] ==
'top' && $arSettingsDefault[
'panelPositionHorizontal'] ==
'left')
208 $arSettingsDefault[
'location'] =
'TL';
209else if ($arSettingsDefault[
'panelPositionVertical'] ==
'top' && $arSettingsDefault[
'panelPositionHorizontal'] ==
'right')
210 $arSettingsDefault[
'location'] =
'TR';
211else if ($arSettingsDefault[
'panelPositionVertical'] ==
'top' && $arSettingsDefault[
'panelPositionHorizontal'] ==
'center')
212 $arSettingsDefault[
'location'] =
'TC';
213else if ($arSettingsDefault[
'panelPositionVertical'] ==
'bottom' && $arSettingsDefault[
'panelPositionHorizontal'] ==
'left')
214 $arSettingsDefault[
'location'] =
'BL';
215else if ($arSettingsDefault[
'panelPositionVertical'] ==
'bottom' && $arSettingsDefault[
'panelPositionHorizontal'] ==
'right')
216 $arSettingsDefault[
'location'] =
'BR';
217else if ($arSettingsDefault[
'panelPositionVertical'] ==
'bottom' && $arSettingsDefault[
'panelPositionHorizontal'] ==
'center')
218 $arSettingsDefault[
'location'] =
'BC';
220$arReferenceId = Array(
221 'select' => Array(
'all',
'contact'),
222 'select3' => Array(
'all',
'contact',
'nobody'),
223 'sendByEnter' => Array(
'Y',
'N'),
224 'location' => Array(
'TL',
'TR',
'TC',
'BL',
'BR',
'BC'),
225 'birthday' => Array(
'all',
'department',
'none'),
228 'select1' => Array(Loc::getMessage(
'IM_SELECT_1'), Loc::getMessage(
'IM_SELECT_2')),
229 'select2' => Array(Loc::getMessage(
'IM_SELECT_1_2'), Loc::getMessage(
'IM_SELECT_2_2')),
230 'select3' => Array(Loc::getMessage(
'IM_SELECT_1_2'), Loc::getMessage(
'IM_SELECT_2_2'), Loc::getMessage(
'IM_SELECT_2_3')),
231 'sendByEnter' => Array(
"Enter",
"Ctrl+Enter"),
232 'location' => Array(Loc::getMessage(
'IM_PANEL_LOCATION_TL'), Loc::getMessage(
'IM_PANEL_LOCATION_TR'), Loc::getMessage(
'IM_PANEL_LOCATION_TC'), Loc::getMessage(
'IM_PANEL_LOCATION_BL'), Loc::getMessage(
'IM_PANEL_LOCATION_BR'), Loc::getMessage(
'IM_PANEL_LOCATION_BC')),
233 'birthday' => Array(Loc::getMessage(
'IM_CONTACT_LIST_BIRTHDAY_ALL'), Loc::getMessage(
'IM_CONTACT_LIST_BIRTHDAY_DEPARTMENT'), Loc::getMessage(
'IM_CONTACT_LIST_BIRTHDAY_NONE')),
237 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_VIEW_OFFLINE")?>:</td>
238 <td
class=
"adm-detail-content-cell-r" width=
"60%"><input type=
"checkbox" name=
"VIEW_OFFLINE" <?=(!$arSettingsDefault[
'viewOffline']?
'checked="checked"' :
'')?>></td>
241 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_VIEW_GROUP")?>:</td>
242 <td
class=
"adm-detail-content-cell-r" width=
"60%"><input type=
"checkbox" name=
"VIEW_GROUP" <?=(!$arSettingsDefault[
'viewGroup']?
'checked="checked"' :
'')?>></td>
245 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_SEND_BY_ENTER")?></td>
246 <td
class=
"adm-detail-content-cell-r" width=
"60%"><?=
SelectBoxFromArray(
"SEND_BY_ENTER",
array(
'reference_id' => $arReferenceId[
'sendByEnter'],
'reference' => $arReference[
'sendByEnter']), $arSettingsDefault[
'sendByEnter']?
'Y':
'N');?></td>
253 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_PANEL_LOCATION")?></td>
254 <td
class=
"adm-detail-content-cell-r" width=
"60%"><?=
SelectBoxFromArray(
"PANEL_LOCATION",
array(
'reference_id' => $arReferenceId[
'location'],
'reference' => $arReference[
'location']), $arSettingsDefault[
'location']);?></td>
258 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_PRIVACY_MESS")?></td>
259 <td
class=
"adm-detail-content-cell-r" width=
"60%"><?=
SelectBoxFromArray(
"PRIVACY_MESSAGE",
array(
'reference_id' => $arReferenceId[
'select'],
'reference' => $arReference[
'select1']), $arSettingsDefault[
'privacyMessage']);?></td>
262 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_PRIVACY_CALL")?></td>
263 <td
class=
"adm-detail-content-cell-r" width=
"60%"><?=
SelectBoxFromArray(
"PRIVACY_CALL",
array(
'reference_id' => $arReferenceId[
'select'],
'reference' => $arReference[
'select1']), $arSettingsDefault[
'privacyCall']);?></td>
266 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_PRIVACY_CHAT")?></td>
267 <td
class=
"adm-detail-content-cell-r" width=
"60%"><?=
SelectBoxFromArray(
"PRIVACY_CHAT",
array(
'reference_id' => $arReferenceId[
'select'],
'reference' => $arReference[
'select2']), $arSettingsDefault[
'privacyChat']);?></td>
270 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_PRIVACY_SEARCH")?></td>
271 <td
class=
"adm-detail-content-cell-r" width=
"60%"><?=
SelectBoxFromArray(
"PRIVACY_SEARCH",
array(
'reference_id' => $arReferenceId[
'select'],
'reference' => $arReference[
'select1']), $arSettingsDefault[
'privacySearch']);?></td>
275 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_PRIVACY_PROFILE")?></td>
276 <td
class=
"adm-detail-content-cell-r" width=
"60%"><?=
SelectBoxFromArray(
"PRIVACY_PROFILE",
array(
'reference_id' => $arReferenceId[
'select3'],
'reference' => $arReference[
'select3']), $arSettingsDefault[
'privacyProfile']);?></td>
281 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_START_CHAT_MESSAGE")?></td>
282 <td
class=
"adm-detail-content-cell-r" width=
"60%"><?=
SelectBoxFromArray(
"START_CHAT_MESSAGE",
array(
'reference_id' => Array(
'first',
'last'),
'reference' => Array(Loc::getMessage(
'IM_START_CHAT_MESSAGE_FIRST'), Loc::getMessage(
'IM_START_CHAT_MESSAGE_LAST'))), COption::GetOptionString(
"im",
'start_chat_message'));?></td>
286 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_CONTACT_LIST_BIRTHDAY")?></td>
287 <td
class=
"adm-detail-content-cell-r" width=
"60%"><?=
SelectBoxFromArray(
"CONTACT_LIST_BIRTHDAY",
array(
'reference_id' => $arReferenceId[
'birthday'],
'reference' => $arReference[
'birthday']), COption::GetOptionString(
"im",
'contact_list_birthday'));?></td>
291 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_COLOR_ENABLE")?>:</td>
292 <td
class=
"adm-detail-content-cell-r" width=
"60%"><input type=
"checkbox" name=
"COLOR_ENABLE" <?=(
COption::GetOptionString(
"im",
'color_enable')?
'checked="checked"' :
'')?>></td>
295 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_OPEN_CHAT_ENABLE")?>:</td>
296 <td
class=
"adm-detail-content-cell-r" width=
"60%"><input type=
"checkbox" name=
"OPEN_CHAT_ENABLE" <?=(
COption::GetOptionString(
"im",
'open_chat_enable')?
'checked="checked"' :
'')?>></td>
300 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_CONTACT_LIST_LOAD")?>:</td>
301 <td
class=
"adm-detail-content-cell-r" width=
"60%"><input type=
"checkbox" name=
"CONTACT_LIST_LOAD" <?=(
COption::GetOptionString(
"im",
'contact_list_load')?
'checked="checked"' :
'')?>></td>
304 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_GENERAL_CHAT_MESSAGE_JOIN")?>:</td>
305 <td
class=
"adm-detail-content-cell-r" width=
"60%"><input type=
"checkbox" name=
"GENERAL_CHAT_MESSAGE_JOIN" <?=(
COption::GetOptionString(
"im",
'general_chat_message_join')?
'checked="checked"' :
'')?>></td>
308 <td
class=
"adm-detail-content-cell-l" width=
"40%"><?=Loc::getMessage(
"IM_GENERAL_CHAT_MESSAGE_LEAVE")?>:</td>
309 <td
class=
"adm-detail-content-cell-r" width=
"60%"><input type=
"checkbox" name=
"GENERAL_CHAT_MESSAGE_LEAVE" <?=(
COption::GetOptionString(
"im",
'general_chat_message_leave')?
'checked="checked"' :
'')?>></td>
313 <td
align=
"right"></td>
327 foreach($arDefValues as
$key=>$value)
329 if (
$key ==
"user_name_template")
333 <td
align =
"right" valign=
"middle" width=
"50%"><?=Loc::getMessage(
"IM_OPTIONS_NAME_TEMPLATE");?>:</td>
336 <
select name=
"<?=$key?>_<?=$site["LID
"]?>">
339 $arNameTemplates = array_reverse($arNameTemplates,
true);
340 $arNameTemplates[
""] = Loc::getMessage(
"IM_OPTIONS_NAME_IN_IM_FORMAT");
341 $arNameTemplates = array_reverse($arNameTemplates,
true);
342 foreach ($arNameTemplates as
$template => $phrase)
345 ?><option value=
"<?= $template?>" <?=((
$template == $curVal) ?
" selected" :
"")?> ><?= $phrase?></option><?
357 <td
align=
"right"><?php echo Loc::getMessage(
"IM_OPTIONS_".mb_strtoupper(
$key))?>:</td>
358 <td><input type=
"text" size=
"40" value=
"<?=htmlspecialcharsbx(COption::GetOptionString("im
", $key, $value, $site["LID
"]))?>" name=
"<?php echo $key?>_<?php echo $site["LID
"]?>"></td>
374function RestoreDefaults()
376 if(confirm(
'<?echo AddSlashes(Loc::getMessage('MAIN_HINT_RESTORE_DEFAULTS_WARNING
'))?>'))
377 window.location =
"<?echo $APPLICATION->GetCurPage()?>?RestoreDefaults=Y&lang=<?echo LANG?>&mid=<?echo urlencode($mid)."&
".bitrix_sessid_get();?>";
380<input type=
"submit" name=
"Update" <?
if (
$MOD_RIGHT<
'W') echo
"disabled" ?> value=
"<?echo Loc::getMessage('MAIN_SAVE')?>">
381<input type=
"reset" name=
"reset" value=
"<?echo Loc::getMessage('MAIN_RESET')?>">
383<input type=
"button" <?
if (
$MOD_RIGHT<
'W') echo
"disabled" ?>
title=
"<?echo Loc::getMessage('MAIN_HINT_RESTORE_DEFAULTS')?>" OnClick=
"RestoreDefaults();" value=
"<?echo Loc::getMessage('MAIN_RESTORE_DEFAULTS')?>">
while($site=$dbSites->Fetch()) $subTabControl
static GetOptionString($module_id, $name, $def="", $site=false, $bExactSite=false)
static GetNameTemplates()
static GetDefaultSettings($type)
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(CIMConvert::ConvertCount() > 0) $arDefaultValues['default']
$_SERVER["DOCUMENT_ROOT"]
if(( $ACTION=='EXPORT_EDIT'||$ACTION=='EXPORT_COPY') &&$STEP==1) if($STEP > 1) if(( $ACTION=='EXPORT_EDIT'||$ACTION=='EXPORT_COPY') &&$STEP==2) if($STEP >2) $aMenu
bitrix_sessid_post($varname='sessid', $returnInvocations=false)
check_bitrix_sessid($varname='sessid')
IsModuleInstalled($module_id)
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
LocalRedirect($url, $skip_security_check=false, $status="302 Found")
SelectBoxFromArray( $strBoxName, $db_array, $strSelectedVal="", $strDetText="", $field1="class='typeselect'", $go=false, $form="form1")
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
<? endif;?> window document title
if(empty($signedUserToken)) $key