Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
presethandler.php
1
<?php
2
3
namespace
Bitrix\Catalog\Component
;
4
5
class
PresetHandler
6
{
20
public
static
function
register
(): bool
21
{
22
$eventManager = \Bitrix\Main\EventManager::getInstance();
23
$eventManager->registerEventHandler(
"main"
,
"OnProlog"
,
"catalog"
,
"\Bitrix\Catalog\Component\PresetHandler"
,
"onProlog"
);
24
return
true
;
25
}
26
31
public
static
function
unRegister
(): bool
32
{
33
$eventManager = \Bitrix\Main\EventManager::getInstance();
34
$eventManager->unRegisterEventHandler(
"main"
,
"OnProlog"
,
"catalog"
,
"\Bitrix\Catalog\Component\PresetHandler"
,
"OnProlog"
);
35
return
true
;
36
}
37
43
public
static
function
onProlog
(): void
44
{
45
\Bitrix\Main\UI\Extension::load([
'catalog.store-use'
]);
46
47
if
(
UseStore::isPlanRestricted
())
48
{
49
UseStore::enable
();
50
}
51
52
$content =
"
53
<script>
54
var controller = new BX.Catalog.StoreUse.Controller();
55
56
controller.inventoryManagementAnalyticsFromLanding();
57
</script>
58
"
;
59
60
global $APPLICATION;
61
$APPLICATION->AddViewContent(
"inline-scripts"
, $content);
62
}
63
}
Bitrix\Catalog\Component\PresetHandler
Definition
presethandler.php:6
Bitrix\Catalog\Component\PresetHandler\unRegister
static unRegister()
Definition
presethandler.php:31
Bitrix\Catalog\Component\PresetHandler\onProlog
static onProlog()
Definition
presethandler.php:43
Bitrix\Catalog\Component\UseStore\enable
static enable()
Definition
usestore.php:107
Bitrix\Catalog\Component\UseStore\isPlanRestricted
static isPlanRestricted()
Definition
usestore.php:51
Bitrix\Catalog\Component
Definition
baseform.php:3
modules
catalog
lib
component
presethandler.php
Создано системой
1.10.0