1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
view.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Landing\Hook\Page;
4
5
use Bitrix\Landing\Field;
6
use Bitrix\Landing\Hook\Page;
7
use Bitrix\Landing\Manager;
8
use Bitrix\Main\Localization\Loc;
9
10
Loc::loadMessages(__FILE__);
11
12
class
View
extends
Page
13
{
18
public
function
getItems
():
array
19
{
20
static
$items
= [];
21
if
(empty(
$items
))
22
{
23
$items
= [
24
'no'
=> Loc::getMessage(
'LANDING_HOOK_VIEW_TYPE_NO'
),
25
'ltr'
=> Loc::getMessage(
'LANDING_HOOK_VIEW_TYPE_LTR'
),
26
'all'
=> Loc::getMessage(
'LANDING_HOOK_VIEW_TYPE_ALL'
),
27
'mobile'
=> Loc::getMessage(
'LANDING_HOOK_VIEW_TYPE_MOBILE'
),
28
'adaptive'
=> Loc::getMessage(
'LANDING_HOOK_VIEW_TYPE_ADAPTIVE'
),
29
];
30
}
31
return
$items
;
32
}
33
38
protected
function
getMap
():
array
39
{
40
return
[
41
'USE'
=>
new
Field\Checkbox
(
'USE'
, [
42
'title'
=> Loc::getMessage(
'LANDING_HOOK_VIEW_USE'
),
43
]),
44
'TYPE'
=>
new
Field\Select
(
'TYPE'
, [
45
'title'
=> Loc::getMessage(
'LANDING_HOOK_VIEW_TYPE'
),
46
'options'
=> $this->
getItems
(),
47
]),
48
];
49
}
50
55
public
function
getTitle
(): string
56
{
57
return
Loc::getMessage(
'LANDING_HOOK_VIEW_NAME'
);
58
}
59
64
public
function
enabled
(): bool
65
{
66
if
($this->
issetCustomExec
())
67
{
68
return
true
;
69
}
70
71
return
$this->fields[
'USE'
]->getValue() ===
'Y'
;
72
}
73
78
public
function
exec
(): void
79
{
80
if
($this->
execCustom
())
81
{
82
return
;
83
}
84
85
$type
= trim($this->fields[
'TYPE'
]);
86
$bodyClass =
''
;
87
$mainClasses =
''
;
88
89
if
(
$type
===
'ltr'
)
90
{
91
$bodyClass =
'landing-viewtype--ltr'
;
92
$mainClasses =
'g-pt-6 g-px-10 g-pt-30--md g-px-50--md'
;
93
}
94
elseif
(
$type
===
'all'
)
95
{
96
$bodyClass =
'landing-viewtype--all'
;
97
$mainClasses =
'g-py-6 g-px-10 g-py-30--md g-px-50--md'
;
98
}
99
elseif
(
$type
===
'mobile'
)
100
{
101
$bodyClass =
'landing-viewtype--mobile'
;
102
$mainClasses =
'mx-auto'
;
103
}
104
elseif
(
$type
===
'adaptive'
)
105
{
106
$bodyClass =
'landing-viewtype--adaptive'
;
107
// $mainClasses = 'mx-auto';
108
}
109
110
Manager::setPageView
(
'BodyClass'
, $bodyClass);
111
Manager::setPageView
(
'MainClass'
, $mainClasses);
112
}
113
}
$type
$type
Определения
options.php:106
Bitrix\Landing\Field\Checkbox
Определения
checkbox.php:5
Bitrix\Landing\Field\Select
Определения
select.php:9
Bitrix\Landing\Hook\Page\View\getMap
getMap()
Определения
view.php:38
Bitrix\Landing\Hook\Page\View\getTitle
getTitle()
Определения
view.php:55
Bitrix\Landing\Hook\Page\View\enabled
enabled()
Определения
view.php:64
Bitrix\Landing\Hook\Page\View\getItems
getItems()
Определения
view.php:18
Bitrix\Landing\Hook\Page\View\exec
exec()
Определения
view.php:78
Bitrix\Landing\Hook\Page\issetCustomExec
issetCustomExec()
Определения
page.php:253
Bitrix\Landing\Hook\Page\execCustom
execCustom()
Определения
page.php:262
Bitrix\Landing\Manager\setPageView
static setPageView(string $marker, string $content, bool $skipTrim=false)
Определения
manager.php:470
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Main\Engine\View
Bitrix\Main\Page
Определения
aliases.php:54
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$items
$items
Определения
template.php:224
bitrix
modules
landing
lib
hook
page
view.php
Создано системой
1.14.0