Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
component.php
1
<?php
2
namespace
Bitrix\Landing\Subtype
;
3
4
use \Bitrix\Landing\Manager;
5
use \Bitrix\Main\Localization\Loc;
6
7
Loc::loadMessages
(__FILE__);
8
9
class
Component
10
{
18
public
static
function
prepareManifest
(array $manifest, \
Bitrix
\
Landing
\
Block
$block =
null
, array $params = array())
19
{
20
$settings = \Bitrix\Landing\Hook\Page\Settings::getDataForSite(
21
$block->getSiteId()
22
);
23
24
// set predefined
25
\Bitrix\Landing\Node\Component::setPredefineForDynamicProps(array(
26
'IBLOCK_ID'
=> $settings[
'IBLOCK_ID'
],
27
'USE_ENHANCED_ECOMMERCE'
=>
'Y'
,
28
'SHOW_DISCOUNT_PERCENT'
=>
'Y'
,
29
'LABEL_PROP'
=> array(
30
'NEWPRODUCT'
,
31
'SALELEADER'
,
32
'SPECIALOFFER'
33
),
34
'CONVERT_CURRENCY'
=>
'Y'
,
35
'LANDING_MODE'
=>
'Y'
36
));
37
38
if
(
39
isset($params[
'required'
]) &&
40
$params[
'required'
] ==
'catalog'
41
)
42
{
43
// check catalog
44
$settings = \Bitrix\Landing\Hook\Page\Settings::getDataForSite(
45
$block->getSiteId()
46
);
47
if
(!$settings[
'IBLOCK_ID'
])
48
{
49
$manifest[
'requiredUserAction'
] = array(
50
'header'
=>
Loc::getMessage
(
'LANDING_BLOCK_EMPTY_CATLOG_TITLE'
),
51
'description'
=>
Loc::getMessage
(
'LANDING_BLOCK_EMPTY_CATLOG_DESC'
),
52
'text'
=>
Loc::getMessage
(
'LANDING_BLOCK_EMPTY_CATLOG_LINK'
),
53
'href'
=>
'#page_url_catalog_edit'
,
54
'className'
=>
'landing-required-link'
55
);
56
}
57
else
if
(
58
!\
Bitrix
\Main\
ModuleManager::isModuleInstalled
(
'bitrix24'
) &&
59
\
Bitrix
\Main\
Loader::includeModule
(
'iblock'
) &&
60
!\
Bitrix
\
Iblock
\Model\PropertyFeature::isEnabledFeatures()
61
)
62
{
63
$manifest[
'requiredUserAction'
] = array(
64
'header'
=>
Loc::getMessage
(
'LANDING_BLOCK_EMPTY_CATLOG_TITLE'
),
65
'description'
=>
Loc::getMessage
(
'LANDING_BLOCK_CATALOG_CONFIG_FEATURE'
),
66
'text'
=>
Loc::getMessage
(
'LANDING_BLOCK_EMPTY_CATLOG_LINK'
),
67
'href'
=>
'/bitrix/admin/settings.php?lang='
. LANGUAGE_ID .
'&mid=iblock'
,
68
'className'
=>
'landing-required-link'
69
);
70
}
71
// add settings link
72
if
($settings[
'IBLOCK_ID'
] && !isset($manifest[
'requiredUserAction'
]))
73
{
74
if
(
75
!isset($manifest[
'block'
]) ||
76
!is_array($manifest[
'block'
])
77
)
78
{
79
$manifest[
'block'
] = array();
80
}
81
if
(Manager::isB24())
82
{
83
$link =
'/shop/settings/menu_catalog_'
. $settings[
'IBLOCK_ID'
] .
'/'
;
84
}
85
else
if
(\
Bitrix
\Main\
Loader::includeModule
(
'iblock'
))
86
{
87
if
($iblock = \CIBlock::getById($settings[
'IBLOCK_ID'
])->fetch())
88
{
89
$link =
'/bitrix/admin/cat_product_list.php?IBLOCK_ID='
. $iblock[
'ID'
] .
90
'&type='
. $iblock[
'IBLOCK_TYPE_ID'
] .
'&lang='
. LANGUAGE_ID .
91
'&find_section_section=-1'
;
92
}
93
}
94
if
(isset($link))
95
{
96
$manifest[
'block'
][
'attrsFormDescription'
] =
'<a href="'
. $link .
'" target="_blank">'
.
97
Loc::getMessage
(
'LANDING_BLOCK_CATALOG_CONFIG'
) .
98
'</a>'
;
99
}
100
}
101
}
102
103
return
$manifest;
104
}
105
}
Bitrix\Landing\Block
Definition
block.php:21
Bitrix\Landing\Connector\Iblock
Definition
iblock.php:7
Bitrix\Landing\Connector\Landing
Definition
landing.php:12
Bitrix\Landing\Node\Component
Definition
component.php:9
Bitrix\Landing\Subtype\Component\prepareManifest
static prepareManifest(array $manifest, \Bitrix\Landing\Block $block=null, array $params=array())
Definition
component.php:18
Bitrix\Main\Loader\includeModule
static includeModule($moduleName)
Definition
loader.php:69
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ModuleManager\isModuleInstalled
static isModuleInstalled($moduleName)
Definition
modulemanager.php:67
Bitrix\Landing\Subtype
Definition
chat.php:2
Bitrix
modules
landing
lib
subtype
component.php
Создано системой
1.10.0