Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
preprocessing.php
1<?php
2
4
5use \Bitrix\Landing\Block;
6use \Bitrix\Crm\CompanyTable;
7use \Bitrix\Landing\Site;
8use \Bitrix\Main\Loader;
9
11{
17 public static function blockAddProcessing(Block $block): void
18 {
19 PreProcessing\Theme::processing($block);
20 PreProcessing\Icon::processing($block);
21 PreProcessing\Font::processing($block);
22 }
23
29 public static function blockUpdateNodeProcessing(Block $block): void
30 {
31 PreProcessing\Icon::processing($block);
32 PreProcessing\Font::processing($block);
33 }
34
40 public static function blockUpdateClassesProcessing(Block $block): void
41 {
42 PreProcessing\Font::processing($block);
43 }
44
50 public static function blockUndeleteProcessing(Block $block): void
51 {
52 PreProcessing\Icon::processing($block);
53 PreProcessing\Font::processing($block);
54 }
55
62 public static function blockViewProcessing(Block $block, bool $editMode = false): void
63 {
64 if (!$editMode)
65 {
66 PreProcessing\Icon::view($block);
67 PreProcessing\CustomExtensions::view($block);
68 }
69 PreProcessing\Font::view($block);
70 }
71
77 public static function blockPublicationProcessing(Block $block): void
78 {
79 if (self::isLazyloadEnable($block->getSiteId()))
80 {
81 PreProcessing\Lazyload::processing($block);
82 }
83 PreProcessing\CustomExtensions::processing($block);
84 }
85
91 public static function blockSetDynamicProcessing(Block $block): void
92 {
93 if (self::isLazyloadEnable($block->getSiteId()))
94 {
95 PreProcessing\Lazyload::processingDynamic($block);
96 }
97 }
98
104 protected static function isLazyloadEnable(int $siteId): bool
105 {
106 static $result;
107 if ($result !== null)
108 {
109 return $result;
110 }
111
112 $hooks = Site::getHooks($siteId);
113 $result =
114 array_key_exists('SPEED', $hooks)
115 && $hooks['SPEED']->getPageFields()['SPEED_USE_LAZY']->getValue() !== 'N';
116
117 return $result;
118 }
119}
static blockUpdateClassesProcessing(Block $block)
static blockAddProcessing(Block $block)
static blockUpdateNodeProcessing(Block $block)
static blockViewProcessing(Block $block, bool $editMode=false)
static blockPublicationProcessing(Block $block)
static blockSetDynamicProcessing(Block $block)
static blockUndeleteProcessing(Block $block)
static getHooks($id)
Definition site.php:200