1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
template.php
См. документацию.
1<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true)
2{
3 die();
4}
5
6$APPLICATION->SetPageProperty("BodyClass", "menu-page");
8?>
9<div class="menu-wrap">
10<div class="menu-items" id="menu-items">
11
12 <?
13
14 $htmlMenu = "";
15
16 foreach ($arResult["MENU"] as $arMenuSection)
17 {
18 if (!isset($arMenuSection['type']) && $arMenuSection['type'] != "section")
19 {
20 continue;
21 }
22
23 $htmlMenu .= '<div class="menu-separator">' . (isset($arMenuSection['text']) ? $arMenuSection['text'] : '') . '</div>';
24
25 if (!isset($arMenuSection['items']) || !is_array($arMenuSection['items']))
26 {
27 continue;
28 }
29
30 $htmlMenu .= '<div class="menu-section menu-section-groups">';
31
32 foreach ($arMenuSection['items'] as $arMenuItem)
33 {
34 $htmlMenu .= '<div class="menu-item';
35
36 if (isset($arMenuItem["class"]))
37 {
38 $htmlMenu .= ' ' . $arMenuItem["class"];
39 }
40
41 $htmlMenu .= '"';
42
43 foreach ($arMenuItem as $attrName => $attrVal)
44 {
45 if ($attrName == 'text' || $attrName == 'type' || $attrName == 'class')
46 {
47 continue;
48 }
49
50 $htmlMenu .= ' ' . $attrName . '="' . $attrVal . '"';
51 }
52
53 $htmlMenu .= '>';
54
55 if (isset($arMenuItem['text']))
56 {
57 $htmlMenu .= $arMenuItem['text'];
58 }
59
60 $htmlMenu .= '</div>';
61 }
62
63 $htmlMenu .= '</div>';
64 }
65
66 echo $htmlMenu;
67 ?>
68</div>
69
70 <div id="mobile_menu_preview_wrap">
71 <div class="navigation-panel"></div>
72 <iframe id="mobile_menu_preview"></iframe>
73 <div id="preview_loading">
74 <div class="loading-label">Loading...</div>
75 </div>
76 </div>
77
78</div>
79
80<script>
81
82 BXMSlider.setStateEnabled(BXMSlider.state.LEFT, true);
83 document.addEventListener("DOMContentLoaded", function ()
84 {
85 Menu.init(null);
86 }, false);
87
88 Menu = {
89 currentItem: null,
90 init: function (currentItem)
91 {
92 this.isDesktop = false;
93
94 var userAgent = navigator.userAgent;
95 if(userAgent.indexOf("Android") < 0 && userAgent.indexOf("iPhone") < 0 && userAgent.indexOf("iPad") < 0)
96 {
97 this.isDesktop = true;
98 }
99 else
100 {
101 BX("menu-items").style.float = "none";
102 }
103 this.currentItem = currentItem;
104 var items = document.getElementById("menu-items");
105 var that = this;
106
107
108 items.addEventListener("click", function (event)
109 {
110 that.onItemClick(event);
111
112 }, false);
113 },
114
115 onItemClick: function (event)
116 {
117 var target = event.target;
118 if (target && target.nodeType && target.nodeType == 1 && BX.hasClass(target, "menu-item"))
119 {
120 if (this.currentItem != null)
121 this.unselectItem(this.currentItem);
122 this.selectItem(target);
123
124 var url = target.getAttribute("data-url");
125 var pageId = target.getAttribute("data-pageid");
126
127 if(!this.isDesktop)
128 {
129 if(BX.type.isNotEmptyString(url) && BX.type.isNotEmptyString(pageId))
130 app.loadPage(url, pageId);
131 else if(BX.type.isNotEmptyString(url))
132 app.loadPage(url);
133 }
134 else
135 {
136 var previewFrame = BX("mobile_menu_preview");
137 var wrapPreview = BX("mobile_menu_preview_wrap");
138 BX("preview_loading").style.display = "table";
139 BX("preview_loading").style.opacity = 1.0;
140
141 wrapPreview.style.display = "inline";
142
143 previewFrame.src = url;
144 previewFrame.onload = function(){
145
146 (new BX.fx({
147 start: 100,
148 finish: 0,
149 type: "linear",
150 time: 0.2,
151 step: 0.05,
152 callback: BX.proxy(function (value)
153 {
154 BX("preview_loading").style.opacity = value/100;
155
156 }, this),
157 callback_complete: function ()
158 {
159 BX("preview_loading").style.display = "none"
160 }
161
162 })).start();
163 }
164 }
165
166 this.currentItem = target;
167 }
168
169 },
170
171 selectItem: function (item)
172 {
173 if (!BX.hasClass(item, "menu-item-selected"))
174 BX.addClass(item, "menu-item-selected");
175 },
176
177 unselectItem: function (item)
178 {
179 BX.removeClass(item, "menu-item-selected");
180 }
181 }
182</script>
global $APPLICATION
Определения include.php:80
$arResult
Определения generate_coupon.php:16
static Init($arExt=array(), $bReturn=false)
Определения jscore.php:66
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
die
Определения quickway.php:367
case callback
Определения wrapper_popup.php:31