Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/ui/lib/FeaturePromoter/ |
Upload File : |
<?php namespace Bitrix\UI\FeaturePromoter; use Bitrix\Main\Result; use Bitrix\Main\Localization\Loc; use Bitrix\UI\Helpdesk; class Popup extends BaseProvider { private const HELPDESK_PATH = '/widget2/restrictive_popup.php'; public function getRendererParameters(): array { $resultLoadingConfigurationFromHelpdesk = $this->loadConfigurationFromHelpdesk(); if ($resultLoadingConfigurationFromHelpdesk->isSuccess()) { $configuration = $resultLoadingConfigurationFromHelpdesk->getData()['popup'] ?? []; $validator = new PopupConfigurationValidator($configuration); return $validator->isValidConfiguration() ? $configuration : $this->getDefaultConfiguration(); } return $this->getDefaultConfiguration(); } private function loadConfigurationFromHelpdesk(): Result { $helpdeskRequest = new Helpdesk\Request(self::HELPDESK_PATH, [ 'url' => $this->configuration->currentUrl, 'code' => $this->configuration->code, ]); return $helpdeskRequest->send(); } private function getDefaultConfiguration(): array { return [ 'header' => [ 'top' => [ 'title' => Loc::getMessage('UI_INFOHELPER_PROVIDER_POPUP_DEFAULT_TOP_TITLE'), ], 'info' => [ 'title' => Loc::getMessage('UI_INFOHELPER_PROVIDER_POPUP_DEFAULT_DEESCRIPTION'), 'roundContent' => '--rocket', 'moreLabel' => Loc::getMessage('UI_INFOHELPER_PROVIDER_POPUP_MORE_BUTTON'), 'code' => 'limit_why_pay_tariff', ], 'button' => [ 'label' => Loc::getMessage('UI_INFOHELPER_PROVIDER_POPUP_EXTRA_BUTTON'), 'url' => '/settings/license_all.php', ], ], ]; } }