1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
layout.php
См. документацию.
1<?php
2
3namespace Bitrix\Landing\Hook\Page;
4
5use Bitrix\Landing\Field;
6use Bitrix\Landing\Hook\Page;
7use Bitrix\Landing\Manager;
8use Bitrix\Main\Localization\Loc;
9use Bitrix\Main\Text\HtmlFilter;
10
11Loc::loadMessages(__FILE__);
12
13class 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}
const DEFAULT_BREAKPOINT
Определения layout.php:15
issetCustomExec()
Определения page.php:253
execCustom()
Определения page.php:262
static setPageView(string $marker, string $content, bool $skipTrim=false)
Определения manager.php:470
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Определения aliases.php:54