1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Popup.php
См. документацию.
1<?php
2
3namespace Bitrix\UI\FeaturePromoter;
4
5use Bitrix\Main\Result;
6use Bitrix\Main\Localization\Loc;
7use Bitrix\UI\Helpdesk;
8
9class Popup extends BaseProvider
10{
11 private const HELPDESK_PATH = '/widget2/restrictive_popup.php';
12
13 public function getRendererParameters(): array
14 {
15 $resultLoadingConfigurationFromHelpdesk = $this->loadConfigurationFromHelpdesk();
16
17 if ($resultLoadingConfigurationFromHelpdesk->isSuccess())
18 {
19 $configuration = $resultLoadingConfigurationFromHelpdesk->getData()['popup'] ?? [];
20 $validator = new PopupConfigurationValidator($configuration);
21
22 return $validator->isValidConfiguration()
23 ? $configuration
24 : $this->getDefaultConfiguration();
25 }
26
27 return $this->getDefaultConfiguration();
28 }
29
30 private function loadConfigurationFromHelpdesk(): Result
31 {
32 $helpdeskRequest = new Helpdesk\Request(self::HELPDESK_PATH, [
33 'url' => $this->configuration->currentUrl,
34 'code' => $this->configuration->code,
35 ]);
36
37 return $helpdeskRequest->send();
38 }
39
40 private function getDefaultConfiguration(): array
41 {
42 return [
43 'header' => [
44 'top' => [
45 'title' => Loc::getMessage('UI_INFOHELPER_PROVIDER_POPUP_DEFAULT_TOP_TITLE'),
46 ],
47 'info' => [
48 'title' => Loc::getMessage('UI_INFOHELPER_PROVIDER_POPUP_DEFAULT_DEESCRIPTION'),
49 'roundContent' => '--rocket',
50 'moreLabel' => Loc::getMessage('UI_INFOHELPER_PROVIDER_POPUP_MORE_BUTTON'),
51 'code' => 'limit_why_pay_tariff',
52 ],
53 'button' => [
54 'label' => Loc::getMessage('UI_INFOHELPER_PROVIDER_POPUP_EXTRA_BUTTON'),
55 'url' => '/settings/license_all.php',
56 ],
57 ],
58 ];
59 }
60}
Определения request.php:10
getRendererParameters()
Определения Popup.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804