PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 1.0.4
Adminify – White Label, Admin Menu Editor, Login Customizer v1.0.4
4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 4.1.17 All 164 releases
adminify / Inc / admin / Options / MenuLayout.php

MenuLayout.php in Adminify – White Label, Admin Menu Editor, Login Customizer 1.0.4, at Inc/admin/Options/MenuLayout.php

497 lines 17.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPAdminify\Inc\Admin\Options;
4
5 use WPAdminify\Inc\Utils ;
6 use WPAdminify\Inc\Admin\AdminSettingsModel ;
7 if ( !defined( 'ABSPATH' ) ) {
8 die;
9 }
10 // Cannot access directly.
11 class MenuLayout extends AdminSettingsModel
12 {
13 public function __construct()
14 {
15 $this->menu_layout_settings();
16 }
17
18 public function get_defaults()
19 {
20 return [
21 'menu_layout_settings' => [
22 'layout_type' => 'vertical',
23 'menu_hover_submenu' => 'classic',
24 'active_menu_style' => 'classic',
25 'menu_mode' => 'classic',
26 'user_info' => false,
27 'user_info_content' => 'text',
28 'legacy_menu' => false,
29 'user_info_avatar' => 'rounded',
30 'horz_menu_type' => 'both',
31 'show_bloglink' => true,
32 'horz_dropdown_icon' => true,
33 'horz_toplinks' => false,
34 'horz_bubble_icon_hide' => false,
35 'horz_long_menu_break' => true,
36 'menu_styles' => [
37 'menu_typography' => [
38 'font-family' => 'Nunito Sans',
39 'type' => 'google',
40 ],
41 'menu_wrapper_padding' => '',
42 'menu_vertical_padding' => '',
43 'horz_menu_parent_padding' => '',
44 'submenu_wrapper_padding' => '',
45 'submenu_vertical_space' => '',
46 'parent_menu_colors' => [
47 'wrap_bg' => '',
48 'hover_bg' => '',
49 'text_color' => '',
50 'text_hover' => '',
51 'active_color' => '',
52 ],
53 'sub_menu_colors' => [
54 'wrap_bg' => '',
55 'hover_bg' => '',
56 'text_color' => '',
57 'text_hover' => '',
58 'active_bg' => '',
59 'active_color' => '',
60 ],
61 'notif_colors' => [
62 'notif_bg' => '',
63 'notif_color' => '',
64 ],
65 ],
66 'user_info_style' => [
67 'info_text_color' => '',
68 'info_text_hover_color' => '',
69 'info_text_border' => [
70 'top' => '',
71 'right' => '',
72 'bottom' => '',
73 'left' => '',
74 'style' => 'solid',
75 'color' => '',
76 ],
77 'info_icon_color' => '',
78 'info_icon_hover_color' => '',
79 ],
80 ],
81 ];
82 }
83
84 public function menu_layout_settings_tab( &$settings_tab )
85 {
86 $settings_tab[] = array(
87 'id' => 'layout_type',
88 'type' => 'button_set',
89 'title' => __( 'Menu Type', WP_ADMINIFY_TD ),
90 'options' => array(
91 'vertical' => __( 'Vertical Menu', WP_ADMINIFY_TD ),
92 'horizontal' => __( 'Horizontal Menu', WP_ADMINIFY_TD ),
93 ),
94 'default' => $this->get_default_field( 'menu_layout_settings' )['layout_type'],
95 );
96 $settings_tab[] = array(
97 'id' => 'menu_hover_submenu',
98 'type' => 'button_set',
99 'title' => __( 'Sub Menu Style', WP_ADMINIFY_TD ),
100 'options' => array(
101 'classic' => __( 'Classic', WP_ADMINIFY_TD ),
102 'accordion' => __( 'Accordion', WP_ADMINIFY_TD ),
103 'toggle' => __( 'Toggle', WP_ADMINIFY_TD ),
104 ),
105 'dependency' => array(
106 'layout_type',
107 '==',
108 'vertical',
109 'true'
110 ),
111 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_hover_submenu'],
112 );
113 $settings_tab[] = array(
114 'id' => 'active_menu_style',
115 'type' => 'button_set',
116 'title' => __( 'Active Menu Style', WP_ADMINIFY_TD ),
117 'options' => array(
118 'classic' => __( 'Classic', WP_ADMINIFY_TD ),
119 'rounded' => __( 'Rounded', WP_ADMINIFY_TD ),
120 ),
121 'dependency' => array(
122 'layout_type',
123 '==',
124 'vertical',
125 'true'
126 ),
127 'default' => $this->get_default_field( 'menu_layout_settings' )['active_menu_style'],
128 );
129 $settings_tab[] = array(
130 'type' => 'notice',
131 'title' => __( 'Horizontal Menu', WP_ADMINIFY_TD ),
132 'style' => 'warning',
133 'content' => Utils::adminify_upgrade_pro(),
134 'dependency' => array(
135 'layout_type',
136 '==',
137 'horizontal',
138 'true'
139 ),
140 );
141 $settings_tab[] = array(
142 'id' => 'menu_mode',
143 'type' => 'button_set',
144 'title' => __( 'Menu Mode', WP_ADMINIFY_TD ),
145 'options' => array(
146 'classic' => __( 'Classic', WP_ADMINIFY_TD ),
147 'icon_menu' => __( 'Mini Icon', WP_ADMINIFY_TD ),
148 'rounded' => __( 'Rounded', WP_ADMINIFY_TD ),
149 ),
150 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_mode'],
151 'dependency' => array(
152 'layout_type',
153 '==',
154 'vertical',
155 'true'
156 ),
157 );
158 $settings_tab[] = array(
159 'type' => 'notice',
160 'title' => __( 'User Info', WP_ADMINIFY_TD ),
161 'style' => 'warning',
162 'content' => Utils::adminify_upgrade_pro(),
163 'dependency' => array(
164 'layout_type',
165 '==',
166 'vertical',
167 'true'
168 ),
169 );
170 $settings_tab[] = array(
171 'id' => 'user_info_content',
172 'type' => 'button_set',
173 'title' => __( 'Content Type', WP_ADMINIFY_TD ),
174 'options' => array(
175 'text' => __( 'Text', WP_ADMINIFY_TD ),
176 'icon' => __( 'Icon', WP_ADMINIFY_TD ),
177 ),
178 'default' => $this->get_default_field( 'menu_layout_settings' )['user_info_content'],
179 'dependency' => array(
180 'user_info|layout_type',
181 '==|==',
182 'true|vertical',
183 'true'
184 ),
185 );
186 $settings_tab[] = array(
187 'id' => 'user_info_avatar',
188 'type' => 'button_set',
189 'title' => __( 'Avatar Type', WP_ADMINIFY_TD ),
190 'options' => array(
191 'rounded' => __( 'Rounded', WP_ADMINIFY_TD ),
192 'square' => __( 'Square', WP_ADMINIFY_TD ),
193 ),
194 'default' => $this->get_default_field( 'menu_layout_settings' )['user_info_avatar'],
195 'dependency' => array(
196 'user_info|layout_type',
197 '==|==',
198 'true|vertical',
199 'true'
200 ),
201 );
202 $settings_tab[] = array(
203 'type' => 'notice',
204 'title' => __( 'Menu Type', WP_ADMINIFY_TD ),
205 'style' => 'warning',
206 'content' => Utils::adminify_upgrade_pro(),
207 'dependency' => array(
208 'layout_type',
209 '==',
210 'horizontal',
211 'true'
212 ),
213 );
214 $settings_tab[] = array(
215 'type' => 'notice',
216 'title' => __( 'Show Blog Link', WP_ADMINIFY_TD ),
217 'style' => 'warning',
218 'content' => Utils::adminify_upgrade_pro(),
219 'dependency' => array(
220 'layout_type',
221 '==',
222 'horizontal',
223 'true'
224 ),
225 );
226 $settings_tab[] = array(
227 'type' => 'notice',
228 'title' => __( 'Dropdown Toggle Icon', WP_ADMINIFY_TD ),
229 'style' => 'warning',
230 'content' => Utils::adminify_upgrade_pro(),
231 'dependency' => array(
232 'layout_type',
233 '==',
234 'horizontal',
235 'true'
236 ),
237 );
238 $settings_tab[] = array(
239 'type' => 'notice',
240 'title' => __( 'Top Menu Links', WP_ADMINIFY_TD ),
241 'style' => 'warning',
242 'content' => Utils::adminify_upgrade_pro(),
243 'dependency' => array(
244 'layout_type',
245 '==',
246 'horizontal',
247 'true'
248 ),
249 );
250 $settings_tab[] = array(
251 'type' => 'notice',
252 'title' => __( 'Bubble Icon', WP_ADMINIFY_TD ),
253 'style' => 'warning',
254 'content' => Utils::adminify_upgrade_pro(),
255 'dependency' => array(
256 'layout_type',
257 '==',
258 'horizontal',
259 'true'
260 ),
261 );
262 $settings_tab[] = array(
263 'type' => 'notice',
264 'title' => __( 'Break Long Lists', WP_ADMINIFY_TD ),
265 'style' => 'warning',
266 'content' => Utils::adminify_upgrade_pro(),
267 'dependency' => array(
268 'layout_type',
269 '==',
270 'horizontal',
271 'true'
272 ),
273 );
274 }
275
276 public function menu_layout_style_tab( &$menu_styles_tab )
277 {
278 $menu_styles_tab[] = array(
279 'type' => 'subheading',
280 'content' => __( 'Menu Styles', WP_ADMINIFY_TD ),
281 );
282 $menu_styles_tab[] = array(
283 'id' => 'menu_typography',
284 'type' => 'typography',
285 'title' => __( 'Font Settings', WP_ADMINIFY_TD ),
286 'font_family' => true,
287 'font_weight' => true,
288 'font_style' => true,
289 'font_size' => true,
290 'line_height' => true,
291 'letter_spacing' => true,
292 'text_align' => true,
293 'text-transform' => true,
294 'color' => false,
295 'subset' => false,
296 'backup_font_family' => false,
297 'font_variant' => false,
298 'word_spacing' => false,
299 'text_decoration' => false,
300 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['menu_typography'],
301 );
302 $menu_styles_tab[] = array(
303 'id' => 'menu_wrapper_padding',
304 'type' => 'spacing',
305 'title' => __( 'Menu Wrapper Padding', WP_ADMINIFY_TD ),
306 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['menu_wrapper_padding'],
307 );
308 $menu_styles_tab[] = array(
309 'id' => 'menu_vertical_padding',
310 'type' => 'slider',
311 'title' => __( 'Parent Menu Vertical Padding', WP_ADMINIFY_TD ),
312 'unit' => 'px',
313 'min' => 1,
314 'max' => 100,
315 'step' => 1,
316 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['menu_vertical_padding'],
317 'dependency' => array(
318 'layout_type',
319 '==',
320 'vertical',
321 'true'
322 ),
323 );
324 $menu_styles_tab[] = array(
325 'type' => 'notice',
326 'title' => __( 'Parent Menu Horizontal Padding', WP_ADMINIFY_TD ),
327 'style' => 'warning',
328 'content' => Utils::adminify_upgrade_pro(),
329 'dependency' => array(
330 'layout_type',
331 '==',
332 'horizontal',
333 'true'
334 ),
335 );
336 $menu_styles_tab[] = array(
337 'id' => 'submenu_wrapper_padding',
338 'type' => 'spacing',
339 'title' => __( 'Sub Menu Wrapper Padding', WP_ADMINIFY_TD ),
340 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['submenu_wrapper_padding'],
341 );
342 $menu_styles_tab[] = array(
343 'id' => 'submenu_vertical_space',
344 'type' => 'slider',
345 'title' => __( 'Sub Menu Vertical Padding', WP_ADMINIFY_TD ),
346 'unit' => 'px',
347 'min' => 1,
348 'max' => 100,
349 'step' => 1,
350 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['submenu_vertical_space'],
351 );
352 $menu_styles_tab[] = array(
353 'type' => 'subheading',
354 'content' => __( 'Color Settings', WP_ADMINIFY_TD ),
355 );
356 $menu_styles_tab[] = array(
357 'id' => 'parent_menu_colors',
358 'type' => 'color_group',
359 'title' => __( 'Parent Menu Colors', WP_ADMINIFY_TD ),
360 'options' => array(
361 'wrap_bg' => __( 'Wrap BG', WP_ADMINIFY_TD ),
362 'hover_bg' => __( 'Menu Hover BG', WP_ADMINIFY_TD ),
363 'text_color' => __( 'Text Color', WP_ADMINIFY_TD ),
364 'text_hover' => __( 'Text Hover', WP_ADMINIFY_TD ),
365 'active_bg' => __( 'Active Menu BG', WP_ADMINIFY_TD ),
366 'active_color' => __( 'Active Menu Color', WP_ADMINIFY_TD ),
367 ),
368 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['parent_menu_colors'],
369 );
370 $menu_styles_tab[] = array(
371 'id' => 'sub_menu_colors',
372 'type' => 'color_group',
373 'title' => __( 'Sub Menu Colors', WP_ADMINIFY_TD ),
374 'options' => array(
375 'wrap_bg' => __( 'Wrap BG', WP_ADMINIFY_TD ),
376 'hover_bg' => __( 'Submenu Hover BG', WP_ADMINIFY_TD ),
377 'text_color' => __( 'Text Color', WP_ADMINIFY_TD ),
378 'text_hover' => __( 'Text Hover', WP_ADMINIFY_TD ),
379 'active_bg' => __( 'Active Submenu BG', WP_ADMINIFY_TD ),
380 'active_color' => __( 'Active Submenu Color', WP_ADMINIFY_TD ),
381 ),
382 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['sub_menu_colors'],
383 );
384 $menu_styles_tab[] = array(
385 'id' => 'notif_colors',
386 'type' => 'color_group',
387 'title' => __( 'Notification Colors', WP_ADMINIFY_TD ),
388 'options' => array(
389 'notif_bg' => __( 'Background', WP_ADMINIFY_TD ),
390 'notif_color' => __( 'Text Color', WP_ADMINIFY_TD ),
391 ),
392 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['notif_colors'],
393 );
394 }
395
396 public function user_info_style_tab( &$user_info_styles_tab )
397 {
398 $user_info_styles_tab[] = array(
399 'type' => 'subheading',
400 'content' => __( 'User Info Style', WP_ADMINIFY_TD ),
401 );
402 $user_info_styles_tab[] = array(
403 'type' => 'notice',
404 'title' => __( 'Link Color', WP_ADMINIFY_TD ),
405 'style' => 'warning',
406 'content' => Utils::adminify_upgrade_pro(),
407 );
408 $user_info_styles_tab[] = array(
409 'type' => 'notice',
410 'title' => __( 'Hover Color', WP_ADMINIFY_TD ),
411 'style' => 'warning',
412 'content' => Utils::adminify_upgrade_pro(),
413 );
414 $user_info_styles_tab[] = array(
415 'type' => 'notice',
416 'title' => __( 'Border', WP_ADMINIFY_TD ),
417 'style' => 'warning',
418 'content' => Utils::adminify_upgrade_pro(),
419 );
420 $user_info_styles_tab[] = array(
421 'type' => 'notice',
422 'title' => __( 'Icon Color', WP_ADMINIFY_TD ),
423 'style' => 'warning',
424 'content' => Utils::adminify_upgrade_pro(),
425 );
426 $user_info_styles_tab[] = array(
427 'type' => 'notice',
428 'title' => __( 'Hover Icon Color', WP_ADMINIFY_TD ),
429 'style' => 'warning',
430 'content' => Utils::adminify_upgrade_pro(),
431 );
432 }
433
434 public function menu_styles_tab( &$styles_tab )
435 {
436 $menu_styles_tab = [];
437 $user_info_styles_tab = [];
438 $this->menu_layout_style_tab( $menu_styles_tab );
439 $this->user_info_style_tab( $user_info_styles_tab );
440 $styles_tab[] = array(
441 'id' => 'menu_styles',
442 'type' => 'fieldset',
443 'title' => '',
444 'fields' => $menu_styles_tab,
445 );
446 $styles_tab[] = array(
447 'id' => 'user_info_style',
448 'type' => 'fieldset',
449 'title' => '',
450 'fields' => $user_info_styles_tab,
451 'dependency' => array(
452 'layout_type',
453 '==',
454 'vertical',
455 'true'
456 ),
457 );
458 }
459
460 public function menu_layout_settings()
461 {
462 if ( !class_exists( 'ADMINIFY' ) ) {
463 return;
464 }
465 $settings_tab = [];
466 $styles_tab = [];
467 $this->menu_layout_settings_tab( $settings_tab );
468 $this->menu_styles_tab( $styles_tab );
469 // Menu Layout Section
470 \ADMINIFY::createSection( $this->prefix, array(
471 'title' => __( 'Menu Settings', WP_ADMINIFY_TD ),
472 'icon' => 'fas fa-bars',
473 'fields' => array( array(
474 'type' => 'subheading',
475 'content' => Utils::adminfiy_help_urls(
476 __( 'Menu Settings', WP_ADMINIFY_TD ),
477 'https://wpadminify.com/kb/dashboard-menu-settings/',
478 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
479 'https://www.facebook.com/groups/jeweltheme',
480 'https://wpadminify.com/support/'
481 ),
482 ), array(
483 'id' => 'menu_layout_settings',
484 'type' => 'tabbed',
485 'title' => '',
486 'tabs' => array( array(
487 'title' => 'Settings',
488 'fields' => $settings_tab,
489 ), array(
490 'title' => 'Styles',
491 'fields' => $styles_tab,
492 ) ),
493 ) ),
494 ) );
495 }
496
497 }