Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
metarobots.php
1<?php
3
4use \Bitrix\Landing\Field;
5use \Bitrix\Main\Localization\Loc;
6
7Loc::loadMessages(__FILE__);
8
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}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29