1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
settings.php
См. документацию.
1<?php
2namespace Bitrix\Im;
3
4use Bitrix\Main\ArgumentException;
5use Bitrix\Main\Config\Option;
6use Bitrix\Main\Context;
7use Bitrix\Main\Web\Json;
8use CUserOptions;
9
11{
12 public static function getLoggerConfig(): array
13 {
14 $types = [
15 'desktop' => true,
16 'log' => false,
17 'info' => false,
18 'warn' => false,
19 'error' => true,
20 'trace' => true,
21 ];
22
24 if (!isset($settings['logger']))
25 {
26 return $types;
27 }
28
29 foreach ($types as $type => $value)
30 {
31 if (isset($settings['logger'][$type]))
32 {
33 $types[$type] = (bool)$settings['logger'][$type];
34 }
35 }
36
37 return $types;
38 }
39
40 public static function isBroadcastingEnabled(): bool
41 {
42 $broadcastingEnabled = false;
43
45
46 if (!isset($settings['call']['broadcast_enabled']))
47 {
48 return $broadcastingEnabled;
49 }
50
51 return (bool)$settings['call']['broadcast_enabled'];
52 }
53
57 public static function isCallBetaAvailable(): bool
58 {
59 $result = Option::get('im', 'call_beta_access', 'N');
60 return $result === 'Y';
61 }
62
66 public static function isAiBetaAvailable(): bool
67 {
68 $result = Option::get('im', 'ai_beta_access', 'N');
69 return $result === 'Y';
70 }
71
72 public static function isV2Available(): bool
73 {
75 if (!$userId)
76 {
77 return false;
78 }
79
80 if (!\Bitrix\Main\Loader::includeModule('intranet'))
81 {
82 return false;
83 }
84
85 return true;
86 }
87
88 public static function isLegacyChatActivated($userId = false): bool
89 {
90 if (!self::isV2Available())
91 {
92 return true;
93 }
94
95 if (Option::get('im', 'legacy_chat_enabled', 'N') === 'Y')
96 {
97 return true;
98 }
99
100 if (CUserOptions::GetOption('im', 'legacy_chat_user_enabled', 'N', $userId) === 'Y')
101 {
102 return true;
103 }
104
105 $isLegacy = Context::getCurrent()?->getRequest()->getQuery('IM_LEGACY');
106
107 return $isLegacy === 'Y';
108 }
109
110 public static function setLegacyChatActivity($active = true, $userId = false): bool
111 {
112 if (!self::isV2Available())
113 {
114 return false;
115 }
116
117 CUserOptions::SetOption('im', 'legacy_chat_user_enabled', $active ? 'Y' : 'N', false, $userId);
118 \Bitrix\Intranet\Composite\CacheProvider::deleteUserCache();
119
120 return true;
121 }
122}
$type
Определения options.php:106
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
static getUserId($userId=null)
Определения common.php:73
Определения settings.php:11
static setLegacyChatActivity($active=true, $userId=false)
Определения settings.php:110
static isCallBetaAvailable()
Определения settings.php:57
static isBroadcastingEnabled()
Определения settings.php:40
static isAiBetaAvailable()
Определения settings.php:66
static isLegacyChatActivated($userId=false)
Определения settings.php:88
static isV2Available()
Определения settings.php:72
static getLoggerConfig()
Определения settings.php:12
static getValue($name)
Определения configuration.php:24
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$settings
Определения product_settings.php:43