1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
map.php
См. документацию.
1<?php
2namespace Bitrix\Landing\Node;
3
4use Bitrix\Landing\History;
5
7{
8 protected const ATTR_MAP = 'data-map';
9
14 public static function getHandlerJS()
15 {
16 return 'BX.Landing.Node.Map';
17 }
18
26 public static function saveNode(\Bitrix\Landing\Block $block, $selector, array $data)
27 {
28 $doc = $block->getDom();
29 $resultList = $doc->querySelectorAll($selector);
30
31 foreach ($data as $pos => $value)
32 {
33 if (isset($resultList[$pos]) && $value)
34 {
35 if (History::isActive())
36 {
37 $history = new History($block->getLandingId(), History::ENTITY_TYPE_LANDING);
38 $history->push('EDIT_MAP', [
39 'block' => $block,
40 'selector' => $selector,
41 'position' => (int)$pos,
42 'valueBefore' => $resultList[$pos]->getAttributes()[self::ATTR_MAP]->getValue(),
43 'valueAfter' => $value,
44 ]);
45 }
46
47 $resultList[$pos]->setAttribute(
48 self::ATTR_MAP,
49 $value
50 );
51 }
52 }
53 }
54
61 public static function getNode(\Bitrix\Landing\Block $block, $selector)
62 {
63 $data = array();
64 $doc = $block->getDom();
65 $resultList = $doc->querySelectorAll($selector);
66
67 foreach ($resultList as $pos => $res)
68 {
69 $data[$pos] = $res->getAttribute(self::ATTR_MAP);
70 }
71
72 return $data;
73 }
74}
Определения map.php:7
const ATTR_MAP
Определения map.php:8
static getNode(\Bitrix\Landing\Block $block, $selector)
Определения map.php:61
static getHandlerJS()
Определения map.php:14
static saveNode(\Bitrix\Landing\Block $block, $selector, array $data)
Определения map.php:26
getAttributes()
Определения node.php:102
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
Определения agent.php:3