File manager - Edit - /home/web/vm-3fadc827.na4u.ru/www/bitrix/modules/rest/lib/marketplace/marketplaceactions.php
Back
<?php namespace Bitrix\Rest\Marketplace; use Bitrix\Main\ArgumentException; use Bitrix\Main\Web\HttpClient; use Bitrix\Main\Web; use Bitrix\Main\ModuleManager; class MarketplaceActions { public static function getItems($placement, $userLang) { $response = []; $items = []; $params = 'placement='.$placement.'&lang='.$userLang; if(ModuleManager::isModuleInstalled('bitrix24')) { $zone = mb_strtolower(\CBitrix24::getPortalZone()); $params .= '&zone='.$zone; } else { $hash = \Bitrix\Main\Analytics\Counter::getAccountId(); $params .= '&hash='.$hash; } $client = new HttpClient(); $client->query(Web\HttpClient::HTTP_GET, 'https://util.1c-bitrix.ru/b24/buttons.php?'.$params); if ($client->getStatus() == 200) { $resp = $client->getResult(); try { $response = Web\Json::decode($resp); } catch (ArgumentException $e) { } } if (is_array($response) && !empty($response)) { foreach ($response as $item) { $items[$item['id']] = [ 'NAME' => $item['name'], 'COLOR' => $item['color'], 'HANDLER' => $item['link'], 'IMAGE' => $item['image'], 'SLIDER' => $item['slider'], ]; } } return $items; } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.29 |
proxy
|
phpinfo
|
Settings