admin_menu.php
12.9 KB
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<?php
/**
* @copyright OCTemplates
* @support https://octemplates.net/
* @license LICENSE.txt
*/
class ControllerOCTemplatesEventsAdminMenu extends Controller {
public function index(&$route, &$data) {
$this->language->load('octemplates/oct_deals');
$oct_deals = [];
if ($this->user->hasPermission('access', 'extension/theme/oct_deals')) {
$oct_deals[] = array(
'name' => $this->language->get('text_oct_deals'),
'href' => $this->url->link('extension/theme/oct_deals', 'user_token=' . $this->session->data['user_token']. '&store_id=0', true),
'children' => []
);
}
$blogs = [];
if ($this->user->hasPermission('access', 'octemplates/blog/oct_blogcategory')) {
$blogs[] = [
'name' => $this->language->get('text_oct_blogcategory'),
'href' => $this->url->link('octemplates/blog/oct_blogcategory', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/blog/oct_blogarticle')) {
$blogs[] = [
'name' => $this->language->get('text_oct_blogarticle'),
'href' => $this->url->link('octemplates/blog/oct_blogarticle', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/blog/oct_blogcomments')) {
$blogs[] = [
'name' => $this->language->get('text_oct_blogcomments'),
'href' => $this->url->link('octemplates/blog/oct_blogcomments', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/blog/oct_blogsettings')) {
$blogs[] = [
'name' => $this->language->get('text_oct_blogsettings'),
'href' => $this->url->link('octemplates/blog/oct_blogsettings', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if (!empty($blogs)) {
$oct_deals[] = [
'name' => $this->language->get('text_oct_blog'),
'href' => '',
'children' => $blogs
];
}
$designs = [];
if ($this->user->hasPermission('access', 'octemplates/design/oct_banner_plus')) {
$designs[] = [
'name' => $this->language->get('text_oct_banner_plus'),
'href' => $this->url->link('octemplates/design/oct_banner_plus', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/design/oct_slideshow_plus')) {
$designs[] = [
'name' => $this->language->get('text_oct_slideshow_plus'),
'href' => $this->url->link('octemplates/design/oct_slideshow_plus', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if (!empty($designs)) {
$oct_deals[] = [
'name' => $this->language->get('text_banner'),
'href' => '',
'children' => $designs
];
}
$sreviews = [];
if ($this->user->hasPermission('access', 'octemplates/module/oct_sreview_subject')) {
$sreviews[] = [
'name' => $this->language->get('text_oct_sreview_subject'),
'href' => $this->url->link('octemplates/module/oct_sreview_subject', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/module/oct_sreview_reviews')) {
$sreviews[] = [
'name' => $this->language->get('text_oct_sreview_reviews'),
'href' => $this->url->link('octemplates/module/oct_sreview_reviews', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/module/oct_sreview_setting')) {
$sreviews[] = [
'name' => $this->language->get('text_oct_sreview_setting'),
'href' => $this->url->link('octemplates/module/oct_sreview_setting', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if (!empty($sreviews)) {
$oct_deals[] = [
'name' => $this->language->get('text_oct_sreview'),
'href' => '',
'children' => $sreviews
];
}
$product_tabs = [];
if ($this->user->hasPermission('access', 'octemplates/module/oct_product_tabs')) {
$product_tabs[] = [
'name' => $this->language->get('text_oct_product_tabs_list'),
'href' => $this->url->link('octemplates/module/oct_product_tabs', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/module/oct_product_tabs_settings')) {
$product_tabs[] = [
'name' => $this->language->get('text_oct_product_tabs_setting'),
'href' => $this->url->link('octemplates/module/oct_product_tabs_settings', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if (!empty($product_tabs)) {
$oct_deals[] = [
'name' => $this->language->get('text_oct_product_tabs'),
'href' => '',
'children' => $product_tabs
];
}
$modules = [];
if ($this->user->hasPermission('access', 'octemplates/module/oct_smart_checkout')) {
$modules[] = [
'name' => $this->language->get('text_menu_oct_smart_checkout'),
'href' => $this->url->link('octemplates/module/oct_smart_checkout', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/module/oct_product_set')) {
$modules[] = [
'name' => $this->language->get('text_oct_product_sets'),
'href' => $this->url->link('octemplates/module/oct_product_set', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/module/oct_popup_view')) {
$modules[] = [
'name' => $this->language->get('text_oct_popup_view'),
'href' => $this->url->link('octemplates/module/oct_popup_view', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/module/oct_popup_purchase')) {
$modules[] = [
'name' => $this->language->get('text_oct_popup_purchase'),
'href' => $this->url->link('octemplates/module/oct_popup_purchase', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/module/oct_stock_notifier')) {
$modules[] = [
'name' => $this->language->get('text_oct_stock_notifier'),
'href' => $this->url->link('octemplates/module/oct_stock_notifier', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/module/oct_popup_call_phone')) {
$modules[] = [
'name' => $this->language->get('text_oct_popup_call_phone'),
'href' => $this->url->link('octemplates/module/oct_popup_call_phone', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/module/oct_popup_found_cheaper')) {
$modules[] = [
'name' => $this->language->get('text_oct_popup_found_cheaper_menu'),
'href' => $this->url->link('octemplates/module/oct_popup_found_cheaper', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/module/oct_policy')) {
$modules[] = [
'name' => $this->language->get('text_oct_policy'),
'href' => $this->url->link('octemplates/module/oct_policy', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/module/oct_information_bar')) {
$modules[] = [
'name' => $this->language->get('text_oct_information_bar'),
'href' => $this->url->link('octemplates/module/oct_information_bar', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/module/oct_subscribe')) {
$modules[] = [
'name' => $this->language->get('text_oct_subscribe'),
'href' => $this->url->link('octemplates/module/oct_subscribe', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/module/oct_404_page')) {
$modules[] = [
'name' => $this->language->get('text_oct_404_page'),
'href' => $this->url->link('octemplates/module/oct_404_page', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if ($this->user->hasPermission('access', 'octemplates/module/oct_product_main_image_option')) {
$modules[] = [
'name' => $this->language->get('text_oct_product_main_image_option'),
'href' => $this->url->link('octemplates/module/oct_product_main_image_option', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if (!empty($modules)) {
$oct_deals[] = [
'name' => $this->language->get('text_module'),
'href' => '',
'children' => $modules
];
}
if (!empty($blog)) {
$oct_deals[] = [
'name' => $this->language->get('text_oct_blog'),
'href' => '',
'children' => $blog
];
}
$faqs = [];
if ($this->user->hasPermission('access', 'octemplates/faq/oct_product_faq')) {
$faqs[] = [
'name' => $this->language->get('text_oct_product_faq'),
'href' => $this->url->link('octemplates/faq/oct_product_faq', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if (!empty($faqs)) {
$oct_deals[] = [
'name' => $this->language->get('text_oct_faq'),
'href' => '',
'children' => $faqs
];
}
$stickers = [];
if ($this->user->hasPermission('access', 'octemplates/stickers/oct_stickers_settings')) {
$stickers[] = [
'name' => $this->language->get('text_oct_stickers_settings_menu'),
'href' => $this->url->link('octemplates/stickers/oct_stickers_settings', 'user_token=' . $this->session->data['user_token'], true),
'children' => []
];
}
if (!empty($stickers)) {
$oct_deals[] = [
'name' => $this->language->get('text_oct_stickers_main'),
'href' => '',
'children' => $stickers
];
}
if (!empty($oct_deals)) {
$first_menu_item = $data['menus'][0];
$data['menus'][0] = [
'id' => 'menu-oct_deals',
'icon' => 'fa fa-shield fa-fw',
'name' => $this->language->get('text_octemplates'),
'href' => '',
'children' => $oct_deals
];
array_unshift($data['menus'], $first_menu_item);
}
}
}