%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 3.146.176.172 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/sale/install/components/bitrix/sale.shop.public.menu/ |
Upload File : |
<? if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); /** * Bitrix vars * * @var array $arParams * @var array $arResult * @global CMain $APPLICATION */ use Bitrix\Main\Loader; use Bitrix\Main\Localization\Loc; use Bitrix\Main\SystemException; use Bitrix\Main\AccessDeniedException; use Bitrix\Main\LoaderException; use Bitrix\Main\ArgumentOutOfRangeException; class CSaleShopPublicMenu extends \CBitrixComponent { public function onIncludeComponentLang() { $this->includeComponentLang(basename(__FILE__)); Loc::loadMessages(__FILE__); } public function onPrepareComponentParams($params) { $params["ADDITIONAL_PARAMS"] = (!empty($params["ADDITIONAL_PARAMS"]) ? $params["ADDITIONAL_PARAMS"] : array()); $params["CONNECT_PAGE"] = (!empty($params["CONNECT_PAGE"]) ? $params["CONNECT_PAGE"] : "Y"); return $params; } public function executeComponent() { try { $this->checkRequiredParams(); $this->setMenuCount(); $this->formatResult(); $this->initCore(); $this->includeComponentTemplate(); } catch(AccessDeniedException $e) { if ($this->arParams["CONNECT_PAGE"] == "Y") { ShowError($e->getMessage()); } } catch(SystemException $e) { ShowError($e->getMessage()); } catch(LoaderException $e) { ShowError($e->getMessage()); } } /** * @throws AccessDeniedException * @throws LoaderException */ protected function checkRequiredParams() { return; // todo if (!Loader::includeModule("crm") || !CCrmPerms::IsAdmin()) { throw new AccessDeniedException(); } } /** * @throws LoaderException * @throws ArgumentOutOfRangeException */ protected function setMenuCount() { $additionalParams = $this->arParams["ADDITIONAL_PARAMS"]; if (Loader::includeModule("crm")) { global $USER; $orderCounter = Bitrix\Crm\Counter\EntityCounterFactory::create( CCrmOwnerType::Order, Bitrix\Crm\Counter\EntityCounterType::ALL, CCrmSecurityHelper::GetCurrentUserID() ); CUserCounter::set($USER->getId(), "shop_all", $orderCounter->getValue(), SITE_ID, "", false); $orderParams = array( "COUNTER" => $orderCounter->getValue(), "COUNTER_ID" => $orderCounter->getCode() ); $this->arParams["GLOBAL_MENU_COUNTER"] = $orderCounter->getValue(); if (!array_key_exists("orders", $additionalParams)) { $additionalParams["orders"] = array(); } $additionalParams["orders"] = array_merge($additionalParams["orders"], $orderParams); } $this->arParams["ADDITIONAL_PARAMS"] = $additionalParams; } protected function formatResult() { $this->arResult = array(); $this->arResult["ADDITIONAL_PARAMS"] = $this->arParams["ADDITIONAL_PARAMS"]; $this->arResult["GLOBAL_MENU_COUNTER"] = $this->arParams["GLOBAL_MENU_COUNTER"] ? $this->arParams["GLOBAL_MENU_COUNTER"] : 0; $this->arResult["CONNECT_PAGE"] = $this->arParams["CONNECT_PAGE"]; } protected function initCore() { \CJSCore::init("admin_sidepanel"); } }