60 $eventManager = EventManager::getInstance();
61 $eventManager->addEventHandler(
'landing',
'onLandingView',
64 $result = new \Bitrix\Main\Entity\EventResult;
65 $options = $event->getParameter(
'options');
66 $options[
'design_block'] = $flag;
67 $options[
'design_block_allowed'] = Restriction\Manager::isAllowed(
'limit_crm_superblock');
68 $result->modifyFields([
160 foreach (self::getRepo() as $repoItem)
163 !isset($repoItem[
'MANIFEST']) ||
164 !is_array($repoItem[
'MANIFEST'])
169 ksort($repoItem[
'MANIFEST']);
170 foreach ([
'nodes',
'style'] as $category)
172 if (isset($repoItem[
'MANIFEST'][$category]))
174 foreach ($repoItem[
'MANIFEST'][$category] as $selector => $item)
176 if (!is_array($item))
180 $selector = trim($selector,
'.');
181 if (!isset($references[$selector]))
183 $references[$selector] = [];
185 if (!isset($references[$selector][$category]))
187 $references[$selector][$category] = [];
189 if (!isset($selectorName[$selector]))
191 $selectorName[$selector] =
Loc::getMessage(
'LANDING_DESIGN_NODE_' . mb_strtoupper($selector));
193 if ($category ===
'style')
195 self::adjustStylesType($selector, $item);
197 $item[
'name'] = $selectorName[$selector];
198 $references[$selector][$category] = $item;
200 isset($repoItem[
'MANIFEST'][
'assets']) &&
201 is_array($repoItem[
'MANIFEST'][
'assets'])
204 $references[$selector][
'assets'] = $repoItem[
'MANIFEST'][
'assets'];
221 static $references = [];
232 if (preg_match_all(
'/[\s"]+((' . implode(
'|', array_keys($references)) .
')[-\d]*)[\s"]+/is', $content, $matches))
234 foreach ($matches[2] as $i => $selector)
236 if (isset($references[$selector]))
238 foreach ($manifest as $code => &$items)
240 if (isset($references[$selector][$code]))
242 $items[
'.'.$matches[1][$i]] = $references[$selector][$code];
246 if (isset($references[$selector][
'assets']))
248 $manifest[
'assets'] = $references[$selector][
'assets'];