Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
layout.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
use
Bitrix\Main\Text\HtmlFilter
;
10
11
Loc::loadMessages
(__FILE__);
12
13
class
Layout
extends
Page
14
{
15
protected
const
DEFAULT_BREAKPOINT
=
'tablet'
;
20
protected
function
getItems
(): array
21
{
22
return
[
23
'mobile'
=>
'on mobile'
,
24
'tablet'
=>
'on tablet'
,
25
'desktop'
=>
'on desktop'
,
26
'all'
=>
'never'
,
27
];
28
}
29
34
protected
function
getMap
(): array
35
{
36
return
[
37
'BREAKPOINT'
=>
new
Field\Select
(
'BREAKPOINT'
, [
38
'title'
=>
'Adaptive view'
,
39
'options'
=> $this->
getItems
(),
40
]),
41
];
42
}
43
48
public
function
getTitle
(): string
49
{
50
return
'Layout breakpoint title'
;
51
// return Loc::getMessage('LANDING_HOOK_VIEW_NAME');
52
}
53
58
public
function
enabled
(): bool
59
{
60
if
($this->
issetCustomExec
())
61
{
62
return
true
;
63
}
64
65
return
(
bool
)$this->fields[
'BREAKPOINT'
]->getValue();
66
}
67
72
public
function
exec
(): void
73
{
74
if
($this->
execCustom
())
75
{
76
return
;
77
}
78
79
$breakpoint = trim(HtmlFilter::encode($this->fields[
'BREAKPOINT'
]));
80
if
(!$breakpoint)
81
{
82
$breakpoint =
self::DEFAULT_BREAKPOINT
;
83
}
84
85
// Manager::setPageView('BodyClass', $bodyClass);
86
Manager::setPageView
(
'MainClass'
,
'landing-layout-breakpoint--'
. $breakpoint);
87
}
88
}
Bitrix\Landing\Assets\Manager
Definition
manager.php:20
Bitrix\Landing\Field\Select
Definition
select.php:9
Bitrix\Landing\Hook\Page\Layout
Definition
layout.php:14
Bitrix\Landing\Hook\Page\Layout\getMap
getMap()
Definition
layout.php:34
Bitrix\Landing\Hook\Page\Layout\DEFAULT_BREAKPOINT
const DEFAULT_BREAKPOINT
Definition
layout.php:15
Bitrix\Landing\Hook\Page\Layout\getTitle
getTitle()
Definition
layout.php:48
Bitrix\Landing\Hook\Page\Layout\enabled
enabled()
Definition
layout.php:58
Bitrix\Landing\Hook\Page\Layout\getItems
getItems()
Definition
layout.php:20
Bitrix\Landing\Hook\Page\Layout\exec
exec()
Definition
layout.php:72
Bitrix\Landing\Hook\Page
Definition
page.php:7
Bitrix\Landing\Hook\Page\issetCustomExec
issetCustomExec()
Definition
page.php:253
Bitrix\Landing\Hook\Page\execCustom
execCustom()
Definition
page.php:262
Bitrix\Landing\Manager\setPageView
static setPageView(string $marker, string $content, bool $skipTrim=false)
Definition
manager.php:465
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Text\HtmlFilter
Definition
htmlfilter.php:11
Bitrix\Landing\Field
Definition
checkbox.php:2
Bitrix\Landing\Hook\Page
Definition
b24button.php:2
modules
landing
lib
hook
page
layout.php
Создано системой
1.10.0