Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
metarobots.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
MetaRobots
extends
\Bitrix\Landing\Hook\Page
10
{
15
protected
function
getMap
()
16
{
17
return
array(
18
'INDEX'
=>
new
Field
\
Checkbox
(
'INDEX'
, array(
19
'title'
=>
Loc::getMessage
(
'LANDING_HOOK_MRINDEX'
)
20
))
21
);
22
}
23
28
public
function
getTitle
()
29
{
30
return
Loc::getMessage
(
'LANDING_HOOK_MR_NAME'
);
31
}
32
37
public
function
enabled
()
38
{
39
return
true
;
//always
40
}
41
46
public
function
enabledInEditMode
()
47
{
48
return
false
;
49
}
50
55
public
function
exec
()
56
{
57
if
($this->
execCustom
())
58
{
59
return
;
60
}
61
62
if
(\
Bitrix
\
Landing
\Landing::getPreviewMode())
63
{
64
$use =
'N'
;
65
}
66
else
67
{
68
$use = $this->fields[
'INDEX'
]->getValue();
69
}
70
\Bitrix\Main\Page\Asset::getInstance()->addString(
71
'<meta name="robots" content="'
. ($use !=
'N'
?
'all'
:
'noindex'
) .
'" />'
72
);
73
}
74
}
Bitrix\Landing\Connector\Landing
Definition
landing.php:12
Bitrix\Landing\Field\Checkbox
Definition
checkbox.php:5
Bitrix\Landing\Field
Definition
field.php:5
Bitrix\Landing\Hook\Page\MetaRobots
Definition
metarobots.php:10
Bitrix\Landing\Hook\Page\MetaRobots\getMap
getMap()
Definition
metarobots.php:15
Bitrix\Landing\Hook\Page\MetaRobots\getTitle
getTitle()
Definition
metarobots.php:28
Bitrix\Landing\Hook\Page\MetaRobots\enabledInEditMode
enabledInEditMode()
Definition
metarobots.php:46
Bitrix\Landing\Hook\Page\MetaRobots\enabled
enabled()
Definition
metarobots.php:37
Bitrix\Landing\Hook\Page\MetaRobots\exec
exec()
Definition
metarobots.php:55
Bitrix\Landing\Hook\Page
Definition
page.php:7
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
Bitrix
modules
landing
lib
hook
page
metarobots.php
Создано системой
1.10.0