Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
marketplaceactions.php
1<?php
2
3
5
6
11
13{
14 public static function getItems($placement, $userLang)
15 {
16 $response = [];
17 $items = [];
18 $params = 'placement='.$placement.'&lang='.$userLang;
20 {
21 $zone = mb_strtolower(\CBitrix24::getPortalZone());
22 $params .= '&zone='.$zone;
23 }
24 else
25 {
26 $hash = \Bitrix\Main\Analytics\Counter::getAccountId();
27 $params .= '&hash='.$hash;
28 }
29
30 $client = new HttpClient();
31 $client->query(Web\HttpClient::HTTP_GET, 'https://util.1c-bitrix.ru/b24/buttons.php?'.$params);
32
33 if ($client->getStatus() == 200)
34 {
35 $resp = $client->getResult();
36 try
37 {
38 $response = Web\Json::decode($resp);
39 }
40 catch (ArgumentException $e)
41 {
42 }
43 }
44
45 if (is_array($response) && !empty($response))
46 {
47 foreach ($response as $item)
48 {
49 $items[$item['id']] = [
50 'NAME' => $item['name'],
51 'COLOR' => $item['color'],
52 'HANDLER' => $item['link'],
53 'IMAGE' => $item['image'],
54 'SLIDER' => $item['slider'],
55 ];
56 }
57 }
58
59 return $items;
60 }
61}
static isModuleInstalled($moduleName)