Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
metayandexverification.php
1
<?php
2
namespace
Bitrix\Landing\Hook\Page
;
3
4
use \Bitrix\Landing\Manager;
5
use \Bitrix\Landing\Field;
6
use \Bitrix\Main\Localization\Loc;
7
8
Loc::loadMessages
(__FILE__);
9
10
class
MetaYandexVerification
extends
\Bitrix\Landing\Hook\Page
11
{
16
protected
function
getMap
()
17
{
18
$helpUrl = \Bitrix\Landing\Help::getHelpUrl(
'META_YANDEX_VERIFICATION'
);
19
return
array(
20
'USE'
=>
new
Field
\
Checkbox
(
'USE'
, array(
21
'title'
=>
Loc::getMessage
(
'LANDING_HOOK_YANDEX_VERIF_TITLE'
)
22
)),
23
'META'
=>
new
Field
\
Text
(
'META'
, array(
24
'title'
=>
Loc::getMessage
(
'LANDING_HOOK_YANDEX_VERIF_TITLE'
),
25
'placeholder'
=>
'<meta name="yandex-verification" content="9fe8a037d323d50a5faed82923c1438f" />'
,
26
'help'
=> $helpUrl
27
?
'<a href="'
. $helpUrl .
'" target="_blank">'
.
28
Loc::getMessage
(
'LANDING_HOOK_DETAIL_HELP'
) .
29
'</a>'
30
:
''
31
))
32
);
33
}
34
39
public
function
enabled
()
40
{
41
if
($this->
issetCustomExec
())
42
{
43
return
true
;
44
}
45
46
return
$this->fields[
'USE'
]->getValue() ==
'Y'
;
47
}
48
53
public
function
enabledInEditMode
()
54
{
55
return
false
;
56
}
57
62
public
function
exec
()
63
{
64
if
($this->
execCustom
())
65
{
66
return
;
67
}
68
69
$meta = trim($this->fields[
'META'
]);
70
71
if
(preg_match(
'#^<meta\s+name="yandex-verification"\s+content="[a-z0-9_\-]+"\s+/*>$#i'
, $meta))
72
{
73
Manager::setPageView
(
'BeforeHeadClose'
, $meta);
74
}
75
}
76
}
Bitrix\Landing\Field\Checkbox
Definition
checkbox.php:5
Bitrix\Landing\Field\Text
Definition
text.php:5
Bitrix\Landing\Field
Definition
field.php:5
Bitrix\Landing\Hook\Page\MetaYandexVerification
Definition
metayandexverification.php:11
Bitrix\Landing\Hook\Page\MetaYandexVerification\getMap
getMap()
Definition
metayandexverification.php:16
Bitrix\Landing\Hook\Page\MetaYandexVerification\enabledInEditMode
enabledInEditMode()
Definition
metayandexverification.php:53
Bitrix\Landing\Hook\Page\MetaYandexVerification\enabled
enabled()
Definition
metayandexverification.php:39
Bitrix\Landing\Hook\Page\MetaYandexVerification\exec
exec()
Definition
metayandexverification.php:62
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\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
metayandexverification.php
Создано системой
1.10.0