Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
help.php
1<?php
2namespace Bitrix\Landing;
3
4class Help
5{
6 const DEFAULT_ZONE_ID = 'en';
7
11 protected static $domains = array(
12 'ru' => 'bitrix24.ru',
13 'by' => 'bitrix24.by',
14 'kz' => 'bitrix24.kz',
15
16 'ua' => 'bitrix24.ua',
17
18 'en' => 'bitrix24.com',
19 'de' => 'bitrix24.de',
20 'es' => 'bitrix24.es',
21 'br' => 'bitrix24.com.br',
22 'pl' => 'bitrix24.pl',
23 'fr' => 'bitrix24.fr',
24 'cn' => 'bitrix24.cn',
25 'in' => 'bitrix24.in',
26 'eu' => 'bitrix24.eu',
27 'tr' => 'bitrix24.com.tr',
28 'it' => 'bitrix24.it',
29 'id' => 'bitrix24.id',
30 'vn' => 'bitrix24.vn',
31 'jp' => 'bitrix24.jp'
32 );
33
37 protected static $helpUrl = array(
38 'SITE_LIMIT_REACHED' => array(
39 'ru' => '6519197',
40 'ua' => '6524403',
41 'en' => '6588287',
42 'de' => '6630821',
43 'es' => '6529315',
44 'br' => '7014601',
45 'fr' => '8460105',
46 'pl' => '10187232'
47 ),
48 'LANDING_EDIT' => array(
49 'ru' => 's105667',
50 'ua' => 's105681',
51 'en' => 's95157',
52 'de' => 's95161',
53 'es' => 's95265',
54 'br' => 's119713',
55 'fr' => 's110613',
56 'pl' => 's127232'
57 ),
58 'DOMAIN_EDIT' => array(
59 'ru' => '6624333',
60 'ua' => '6626953',
61 'en' => '7389089',
62 'de' => '6637101',
63 'es' => '8479199',
64 'br' => '8513557',
65 'fr' => '8460145',
66 'pl' => '10187266'
67 ),
68 'DOMAIN_BITRIX24' => array(
69 'ru' => '11341354'
70 ),
71 'COOKIES_EDIT' => array(
72 'ru' => '12297162',
73 'ua' => '12300133',
74 'en' => '12299818',
75 'de' => '12300978',
76 'es' => '12304458',
77 'br' => '12309218',
78 'pl' => '12309012',
79 'fr' => '12304424'
80 ),
81 'DOMAIN_FREE' => array(
82 'ru' => '11341378',
83 'ua' => '12208347'
84 ),
85 'GMAP_EDIT' => array(
86 'ru' => '8203739',
87 'ua' => '8223491',
88 'en' => '8218073',
89 'de' => '8208835',
90 'es' => '8210537',
91 'br' => '8234081',
92 'fr' => '9221199'
93 ),
94 'PIXEL' => array(
95 'ru' => '9022893',
96 'ua' => '9028735',
97 'en' => '9025097',
98 'de' => '9024719',
99 'es' => '9023659',
100 'br' => '9029347',
101 'fr' => '9392177'
102 ),
103 'GTM' => array(
104 'ru' => '9488927',
105 'ua' => '9490499',
106 'en' => '9510537',
107 'de' => '9492673',
108 'es' => '9496717',
109 'br' => '9497065',
110 'fr' => '9493337'
111 ),
112 'GACOUNTER' => array(
113 'ru' => '13063040',
114 'ua' => '13141871',
115 'en' => '13557638',
116 'de' => '9490439',
117 'es' => '13118496',
118 'br' => '13113344',
119 'fr' => '13110090'
120 ),
121 'META_GOOGLE_VERIFICATION' => array(
122 'ru' => '7908779',
123 'ua' => '7917063',
124 'en' => '7949461',
125 'de' => '7920223',
126 'es' => '7993185',
127 'br' => '8828551',
128 'fr' => '9203285',
129 'pl' => '10187376'
130 ),
131 'DYNAMIC_BLOCKS' => array(
132 'ru' => '10104989',
133 'ua' => '10119783',
134 'en' => '10134346',
135 'de' => '10119494',
136 'es' => '10133942',
137 'fr' => '10133930'
138 ),
139 'YACOUNTER' => array(
140 'ru' => '9494147'
141 ),
142 'META_YANDEX_VERIFICATION' => array(
143 'ru' => '7919271'
144 ),
145 'SPEED' => array(
146 'ru' => '11565144',
147 'ua' => '11567047',
148 'en' => '11566690',
149 'de' => '11566686',
150 'es' => '11566722',
151 'br' => '11566728',
152 'pl' => '11583638',
153 'fr' => '11566680'
154 ),
155 'FORM_EDIT' => array(
156 'ru' => '12619286',
157 'en' => '12722820',
158 'es' => '12674434',
159 'pl' => '12768522'
160 ),
161 'FORM_GENERAL' => array(
162 'ru' => '6875449',
163 'ua' => '5887811',
164 'en' => '9368711',
165 'de' => '8710329',
166 'es' => '8653779',
167 'br' => '9254221',
168 'pl' => '10186974',
169 'fr' => '9848565'
170 ),
171 'WIDGET_GENERAL' => array(
172 'ru' => '6986667',
173 'ua' => '6904255',
174 'en' => '4112659',
175 'de' => '4116021',
176 'es' => '5471995',
177 'br' => '6345873',
178 'pl' => '10186996',
179 'fr' => '8459729'
180 ),
181 'FREE_MESSAGES' => array(
182 'ru' => '13655934'
183 ),
184 'FIRST_ORDER_REQUIREMENTS' => array(
185 'ru' => '15732254'
186 ),
187 'KNOWLEDGE_EXTENSION' => [
188 'ru' => '11409302',
189 'en' => '11422228',
190 'de' => '11421192',
191 'es' => '11484596',
192 'br' => '11490900',
193 'pl' => '11712796',
194 'fr' => '11422310',
195 ],
196 'B24BUTTON' => [
197 'ru' => '17013614',
198 'en' => '17132068',
199 'de' => '17123424',
200 'es' => '17130132',
201 'br' => '17132448',
202 'pl' => '17138082',
203 'fr' => '17128894',
204 'it' => '17165156',
205 ],
206 );
207
212 public static function getDomains()
213 {
214 return self::$domains;
215 }
216
223 public static function getHelpData(string $code, ?string $zone = null): array
224 {
225 static $myZone = null;
226 static $defaultZone = self::DEFAULT_ZONE_ID;
227
228 if ($zone && isset(self::$helpUrl[$code][$zone]))
229 {
230 return [self::$helpUrl[$code][$zone], $zone];
231 }
232
233 if ($myZone === null)
234 {
235 $myZone = Manager::getZone();
236 }
237
238 if ($myZone == 'by' || $myZone == 'kz')
239 {
240 $myZone = 'ru';
241 }
242
243 $helpId = 0;
244 $helpZone = '';
245
246 if (isset(self::$helpUrl[$code]))
247 {
248 if (isset(self::$helpUrl[$code][$myZone]))
249 {
250 $helpId = self::$helpUrl[$code][$myZone];
251 $helpZone = $myZone;
252 }
253 elseif (isset(self::$helpUrl[$code][$defaultZone]))
254 {
255 $helpId = self::$helpUrl[$code][$defaultZone];
256 $helpZone = $defaultZone;
257 }
258 }
259
260 return [$helpId, $helpZone];
261 }
262
268 public static function getHelpUrl(string $code): string
269 {
270 [$helpId, $helpZone] = self::getHelpData($code);
271
272 if ($helpId && $helpZone)
273 {
274 return 'https://helpdesk.' . self::$domains[$helpZone] .
275 (
276 (mb_substr($helpId, 0, 1) == 's')
277 ? ('/section/'.mb_substr($helpId, 1) . '/')
278 : ('/open/' . $helpId . '/')
279 );
280 }
281
282 return '';
283 }
284
290 public static function replaceHelpUrl($content)
291 {
292 return preg_replace_callback(
293 '/#HELP_LINK_([\w]+)#/',
294 function($match)
295 {
296 return \Bitrix\Landing\Help::getHelpUrl($match[1]);
297 },
298 $content
299 );
300 }
301}
const DEFAULT_ZONE_ID
Definition help.php:6
static $domains
Definition help.php:11
static getHelpUrl(string $code)
Definition help.php:268
static getHelpData(string $code, ?string $zone=null)
Definition help.php:223
static $helpUrl
Definition help.php:37
static replaceHelpUrl($content)
Definition help.php:290
static getDomains()
Definition help.php:212