-
Notifications
You must be signed in to change notification settings - Fork 1
/
rsmm_default.html5
165 lines (131 loc) · 4.62 KB
/
rsmm_default.html5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<div class="mega-dropdown <?= $this->level ?> <?= $this->cssClass ?>"<?php if ($this->cssId): ?> id="<?= $this->cssId ?>"<?php endif ?><?php if ($this->backgroundStyle): ?> style="<?= $this->backgroundStyle ?>"<?php endif ?>>
<div class="mega-dropdown-inner">
<?php if ($this->slider): ?>
<div class="mega-dropdown-slider">
<?php endif ?>
<?php if ($this->type === 'html'): ?>
<?= $this->html ?>
<?php elseif($this->type === 'auto'): ?>
<?php foreach ($this->pages as $index => $page): ?>
<section class="mega-dropdown-column <?= $page['class'] ?> <?= $this->getColumnClassName($index) ?>">
<h3>
<?php if ($page['href']): ?>
<a href="<?= $page['href'] ?>"<?= $page['target'] ?>>
<?php endif ?>
<?= $page['link'] ?>
<?php if ($page['href']): ?>
</a>
<?php endif ?>
</h3>
<?php if (count($page['pages'])): ?>
<ul>
<?php foreach ($page['pages'] as $subPage): ?>
<li class="<?= $subPage['class'] ?>">
<?php if ($subPage['href']): ?>
<a href="<?= $subPage['href'] ?>" class="<?= $subPage['class'] ?>"<?= $subPage['target'] ?>>
<?php endif ?>
<?= $subPage['link'] ?>
<?php if ($subPage['href']): ?>
</a>
<?php endif ?>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
</section>
<?php endforeach ?>
<?php elseif($this->type === 'auto_images'): ?>
<?php foreach ($this->pages as $index => $page): ?>
<section class="mega-dropdown-column <?= $page['class'] ?> <?= $this->getColumnClassName($index) ?>">
<h3>
<?php if ($page['href']): ?>
<a href="<?= $page['href'] ?>"<?= $page['target'] ?>>
<?php endif ?>
<?= $page['link'] ?>
<?php if ($page['href']): ?>
</a>
<?php endif ?>
</h3>
<?php if ($page['rsmm_image']): ?>
<div class="mega-dropdown-image">
<?php if ($page['href']): ?>
<a href="<?= $page['href'] ?>"<?= $page['target'] ?>>
<?php endif ?>
<?php $this->insert('picture_default', $page['rsmm_image']->picture) ?>
<?php if ($page['href']): ?>
</a>
<?php endif ?>
</div>
<?php endif ?>
</section>
<?php endforeach ?>
<?php else: ?>
<?php foreach ($this->columns as $index => $column): ?>
<section class="mega-dropdown-column <?= $column['cssClass'] ?> <?= $this->getColumnClassName($index) ?>"<?php if ($column['cssId']): ?> id="<?= $column['cssId'] ?>"<?php endif ?>>
<?php if ($column['displayName'] || $column['type'] === 'link'): ?>
<h3>
<?php if ($column['page'] && $column['page']['href']): ?>
<a href="<?= $column['page']['href'] ?>"<?= $column['page']['target'] ?>>
<?php endif ?>
<?= $column['name'] ?>
<?php if ($column['page'] && $column['page']['href']): ?>
</a>
<?php endif ?>
</h3>
<?php endif ?>
<?php if ($column['image']): ?>
<div class="mega-dropdown-image">
<?php if ($column['page'] && $column['page']['href']): ?>
<a href="<?= $column['page']['href'] ?>"<?= $column['page']['target'] ?>>
<?php endif ?>
<?php $this->insert('picture_default', $column['image']->picture) ?>
<?php if ($column['page'] && $column['page']['href']): ?>
</a>
<?php endif ?>
</div>
<?php endif ?>
<?php if (trim($column['text'])): ?>
<div class="mega-dropdown-text">
<?= $column['text'] ?>
</div>
<?php endif ?>
<?php if (count($column['pages'])): ?>
<ul>
<?php foreach ($column['pages'] as $subPage): ?>
<li class="<?= $subPage['class'] ?>">
<?php if ($subPage['href']): ?>
<a href="<?= $subPage['href'] ?>" class="<?= $subPage['class'] ?>"<?= $subPage['target'] ?>>
<?php endif ?>
<?php if (($column['type'] === 'manual_image' || $column['type'] === 'auto_image') && $subPage['rsmm_image']): ?>
<?php $this->insert('picture_default', $subPage['rsmm_image']->picture) ?>
<?php endif ?>
<?= $subPage['link'] ?>
<?php if ($subPage['href']): ?>
</a>
<?php endif ?>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<?php if ($column['type'] === 'html'): ?>
<?= $column['html'] ?>
<?php endif ?>
</section>
<?php endforeach ?>
<?php endif ?>
<?php if ($this->slider): ?>
</div>
<script>
(function($) {
var slider = $('.mega-dropdown-slider').last();
slider.rstSlider(<?= json_encode($this->sliderOptions) ?>);
slider.parent().parent().parent().on('mouseenter', function() {
if (slider.data('rstSlider')) {
slider.data('rstSlider').resize();
}
});
})(jQuery);
</script>
<?php endif ?>
</div>
</div>