Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
cssblock.php
1
<?php
2
namespace
Bitrix\Landing\Hook\Page
;
3
4
use \Bitrix\Landing\Field;
5
use \Bitrix\Main\Localization\Loc;
6
7
Loc::loadMessages
(__FILE__);
8
9
class
CssBlock
extends
\Bitrix\Landing\Hook\Page
10
{
15
protected
function
getMap
()
16
{
17
return
array(
18
'USE'
=>
new
Field
\
Checkbox
(
'USE'
, array(
19
'title'
=>
Loc::getMessage
(
'LANDING_HOOK_CSSLOCK_USE'
)
20
)),
21
'CODE'
=>
new
Field
\
Textarea
(
'CODE'
, array(
22
'title'
=>
Loc::getMessage
(
'LANDING_HOOK_HEADBLOCK_CSS_CODE'
),
23
'help'
=>
Loc::getMessage
(
'LANDING_HOOK_HEADBLOCK_CSS_CODE_HELP2'
),
24
'placeholder'
=>
'* {display: none;}'
25
)),
26
'FILE'
=>
new
Field
\
Textarea
(
'FILE'
, array(
27
'title'
=>
Loc::getMessage
(
'LANDING_HOOK_HEADBLOCK_CSS_FILE'
)
28
))
29
);
30
}
31
36
public
function
getTitle
()
37
{
38
return
Loc::getMessage
(
'LANDING_HOOK_CSSBLOCK_NAME'
);
39
}
40
45
public
function
getSort
()
46
{
47
return
500;
48
}
49
54
public
function
enabled
()
55
{
56
if
($this->
issetCustomExec
())
57
{
58
return
true
;
59
}
60
61
return
$this->fields[
'USE'
]->getValue() ==
'Y'
;
62
}
63
68
public
function
enabledInEditMode
()
69
{
70
return
false
;
71
}
72
77
public
function
exec
()
78
{
79
if
($this->
execCustom
())
80
{
81
return
;
82
}
83
84
$cssCode = trim($this->fields[
'CODE'
]);
85
$cssFile = trim($this->fields[
'FILE'
]);
86
87
if
($cssCode !=
''
)
88
{
89
echo
'<style type="text/css">'
. $cssCode .
'</style>'
;
90
}
91
if
($cssFile !=
''
)
92
{
93
echo
'<link href="'
. \htmlspecialcharsbx($cssFile) .
'" type="text/css" rel="stylesheet" />'
;
94
}
95
}
96
}
Bitrix\Landing\Field\Checkbox
Definition
checkbox.php:5
Bitrix\Landing\Field\Textarea
Definition
textarea.php:5
Bitrix\Landing\Field
Definition
field.php:5
Bitrix\Landing\Hook\Page\CssBlock
Definition
cssblock.php:10
Bitrix\Landing\Hook\Page\CssBlock\getMap
getMap()
Definition
cssblock.php:15
Bitrix\Landing\Hook\Page\CssBlock\getTitle
getTitle()
Definition
cssblock.php:36
Bitrix\Landing\Hook\Page\CssBlock\getSort
getSort()
Definition
cssblock.php:45
Bitrix\Landing\Hook\Page\CssBlock\enabledInEditMode
enabledInEditMode()
Definition
cssblock.php:68
Bitrix\Landing\Hook\Page\CssBlock\enabled
enabled()
Definition
cssblock.php:54
Bitrix\Landing\Hook\Page\CssBlock\exec
exec()
Definition
cssblock.php:77
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\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\Landing\Hook\Page
Definition
b24button.php:2
modules
landing
lib
hook
page
cssblock.php
Создано системой
1.10.0