PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 2.0.0
Adminify – White Label, Admin Menu Editor, Login Customizer v2.0.0
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 2.0.0, at Inc/Admin/Options/MenuLayout.php

508 lines 18.3 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 'type' => 'notice',
98 'style' => 'warning',
99 'content' => Utils::adminify_upgrade_pro( 'Horizontal Menu Requires "Adminify UI" Module Enabled from "WP Adminify>Modules" list ' ),
100 'dependency' => array(
101 'admin_ui|layout_type',
102 '!=|==',
103 'true|horizontal',
104 'true'
105 ),
106 );
107 $settings_tab[] = array(
108 'id' => 'menu_hover_submenu',
109 'type' => 'button_set',
110 'title' => __( 'Sub Menu Style', WP_ADMINIFY_TD ),
111 'options' => array(
112 'classic' => __( 'Classic', WP_ADMINIFY_TD ),
113 'accordion' => __( 'Accordion', WP_ADMINIFY_TD ),
114 'toggle' => __( 'Toggle', WP_ADMINIFY_TD ),
115 ),
116 'dependency' => array(
117 'layout_type',
118 '==',
119 'vertical',
120 'true'
121 ),
122 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_hover_submenu'],
123 );
124 $settings_tab[] = array(
125 'id' => 'active_menu_style',
126 'type' => 'button_set',
127 'title' => __( 'Active Menu Style', WP_ADMINIFY_TD ),
128 'options' => array(
129 'classic' => __( 'Classic', WP_ADMINIFY_TD ),
130 'rounded' => __( 'Rounded', WP_ADMINIFY_TD ),
131 ),
132 'dependency' => array(
133 'layout_type',
134 '==',
135 'vertical',
136 'true'
137 ),
138 'default' => $this->get_default_field( 'menu_layout_settings' )['active_menu_style'],
139 );
140 $settings_tab[] = array(
141 'type' => 'notice',
142 'title' => __( 'Horizontal Menu', WP_ADMINIFY_TD ),
143 'style' => 'warning',
144 'content' => Utils::adminify_upgrade_pro(),
145 'dependency' => array(
146 'admin_ui|layout_type',
147 '==|==',
148 'true|horizontal',
149 'true'
150 ),
151 );
152 $settings_tab[] = array(
153 'id' => 'menu_mode',
154 'type' => 'button_set',
155 'title' => __( 'Menu Mode', WP_ADMINIFY_TD ),
156 'options' => array(
157 'classic' => __( 'Classic', WP_ADMINIFY_TD ),
158 'icon_menu' => __( 'Mini Icon', WP_ADMINIFY_TD ),
159 'rounded' => __( 'Rounded', WP_ADMINIFY_TD ),
160 ),
161 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_mode'],
162 'dependency' => array(
163 'layout_type',
164 '==',
165 'vertical',
166 'true'
167 ),
168 );
169 $settings_tab[] = array(
170 'type' => 'notice',
171 'title' => __( 'User Info', WP_ADMINIFY_TD ),
172 'style' => 'warning',
173 'content' => Utils::adminify_upgrade_pro(),
174 'dependency' => array(
175 'layout_type',
176 '==',
177 'vertical',
178 'true'
179 ),
180 );
181 $settings_tab[] = array(
182 'id' => 'user_info_content',
183 'type' => 'button_set',
184 'title' => __( 'Content Type', WP_ADMINIFY_TD ),
185 'options' => array(
186 'text' => __( 'Text', WP_ADMINIFY_TD ),
187 'icon' => __( 'Icon', WP_ADMINIFY_TD ),
188 ),
189 'default' => $this->get_default_field( 'menu_layout_settings' )['user_info_content'],
190 'dependency' => array(
191 'user_info|layout_type',
192 '==|==',
193 'true|vertical',
194 'true'
195 ),
196 );
197 $settings_tab[] = array(
198 'id' => 'user_info_avatar',
199 'type' => 'button_set',
200 'title' => __( 'Avatar Type', WP_ADMINIFY_TD ),
201 'options' => array(
202 'rounded' => __( 'Rounded', WP_ADMINIFY_TD ),
203 'square' => __( 'Square', WP_ADMINIFY_TD ),
204 ),
205 'default' => $this->get_default_field( 'menu_layout_settings' )['user_info_avatar'],
206 'dependency' => array(
207 'user_info|layout_type',
208 '==|==',
209 'true|vertical',
210 'true'
211 ),
212 );
213 $settings_tab[] = array(
214 'type' => 'notice',
215 'title' => __( 'Menu Item Style', WP_ADMINIFY_TD ),
216 'style' => 'warning',
217 'content' => Utils::adminify_upgrade_pro(),
218 'dependency' => array(
219 'layout_type',
220 '==',
221 'horizontal',
222 'true'
223 ),
224 );
225 $settings_tab[] = array(
226 'type' => 'notice',
227 'title' => __( 'Show Blog Link', WP_ADMINIFY_TD ),
228 'style' => 'warning',
229 'content' => Utils::adminify_upgrade_pro(),
230 'dependency' => array(
231 'layout_type',
232 '==',
233 'horizontal',
234 'true'
235 ),
236 );
237 $settings_tab[] = array(
238 'type' => 'notice',
239 'title' => __( 'Dropdown Toggle Icon', WP_ADMINIFY_TD ),
240 'style' => 'warning',
241 'content' => Utils::adminify_upgrade_pro(),
242 'dependency' => array(
243 'layout_type',
244 '==',
245 'horizontal',
246 'true'
247 ),
248 );
249 $settings_tab[] = array(
250 'type' => 'notice',
251 'title' => __( 'Top Menu Links', WP_ADMINIFY_TD ),
252 'style' => 'warning',
253 'content' => Utils::adminify_upgrade_pro(),
254 'dependency' => array(
255 'layout_type',
256 '==',
257 'horizontal',
258 'true'
259 ),
260 );
261 $settings_tab[] = array(
262 'type' => 'notice',
263 'title' => __( 'Bubble Icon', WP_ADMINIFY_TD ),
264 'style' => 'warning',
265 'content' => Utils::adminify_upgrade_pro(),
266 'dependency' => array(
267 'layout_type',
268 '==',
269 'horizontal',
270 'true'
271 ),
272 );
273 $settings_tab[] = array(
274 'type' => 'notice',
275 'title' => __( 'Break Long Lists', WP_ADMINIFY_TD ),
276 'style' => 'warning',
277 'content' => Utils::adminify_upgrade_pro(),
278 'dependency' => array(
279 'layout_type',
280 '==',
281 'horizontal',
282 'true'
283 ),
284 );
285 }
286
287 public function menu_layout_style_tab( &$menu_styles_tab )
288 {
289 $menu_styles_tab[] = array(
290 'type' => 'subheading',
291 'content' => __( 'Menu Styles', WP_ADMINIFY_TD ),
292 );
293 $menu_styles_tab[] = array(
294 'id' => 'menu_typography',
295 'type' => 'typography',
296 'title' => __( 'Font Settings', WP_ADMINIFY_TD ),
297 'font_family' => true,
298 'font_weight' => true,
299 'font_style' => true,
300 'font_size' => true,
301 'line_height' => true,
302 'letter_spacing' => true,
303 'text_align' => true,
304 'text-transform' => true,
305 'color' => false,
306 'subset' => false,
307 'backup_font_family' => false,
308 'font_variant' => false,
309 'word_spacing' => false,
310 'text_decoration' => false,
311 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['menu_typography'],
312 );
313 $menu_styles_tab[] = array(
314 'id' => 'menu_wrapper_padding',
315 'type' => 'spacing',
316 'title' => __( 'Menu Wrapper Padding', WP_ADMINIFY_TD ),
317 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['menu_wrapper_padding'],
318 );
319 $menu_styles_tab[] = array(
320 'id' => 'menu_vertical_padding',
321 'type' => 'slider',
322 'title' => __( 'Parent Menu Vertical Padding', WP_ADMINIFY_TD ),
323 'unit' => 'px',
324 'min' => 1,
325 'max' => 100,
326 'step' => 1,
327 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['menu_vertical_padding'],
328 'dependency' => array(
329 'layout_type',
330 '==',
331 'vertical',
332 'true'
333 ),
334 );
335 $menu_styles_tab[] = array(
336 'type' => 'notice',
337 'title' => __( 'Parent Menu Horizontal Padding', WP_ADMINIFY_TD ),
338 'style' => 'warning',
339 'content' => Utils::adminify_upgrade_pro(),
340 'dependency' => array(
341 'layout_type',
342 '==',
343 'horizontal',
344 'true'
345 ),
346 );
347 $menu_styles_tab[] = array(
348 'id' => 'submenu_wrapper_padding',
349 'type' => 'spacing',
350 'title' => __( 'Sub Menu Wrapper Padding', WP_ADMINIFY_TD ),
351 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['submenu_wrapper_padding'],
352 );
353 $menu_styles_tab[] = array(
354 'id' => 'submenu_vertical_space',
355 'type' => 'slider',
356 'title' => __( 'Sub Menu Vertical Padding', WP_ADMINIFY_TD ),
357 'unit' => 'px',
358 'min' => 1,
359 'max' => 100,
360 'step' => 1,
361 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['submenu_vertical_space'],
362 );
363 $menu_styles_tab[] = array(
364 'type' => 'subheading',
365 'content' => __( 'Color Settings', WP_ADMINIFY_TD ),
366 );
367 $menu_styles_tab[] = array(
368 'id' => 'parent_menu_colors',
369 'type' => 'color_group',
370 'title' => __( 'Parent Menu Colors', WP_ADMINIFY_TD ),
371 'options' => array(
372 'wrap_bg' => __( 'Wrap BG', WP_ADMINIFY_TD ),
373 'hover_bg' => __( 'Menu Hover BG', WP_ADMINIFY_TD ),
374 'text_color' => __( 'Text Color', WP_ADMINIFY_TD ),
375 'text_hover' => __( 'Text Hover', WP_ADMINIFY_TD ),
376 'active_bg' => __( 'Active Menu BG', WP_ADMINIFY_TD ),
377 'active_color' => __( 'Active Menu Color', WP_ADMINIFY_TD ),
378 ),
379 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['parent_menu_colors'],
380 );
381 $menu_styles_tab[] = array(
382 'id' => 'sub_menu_colors',
383 'type' => 'color_group',
384 'title' => __( 'Sub Menu Colors', WP_ADMINIFY_TD ),
385 'options' => array(
386 'wrap_bg' => __( 'Wrap BG', WP_ADMINIFY_TD ),
387 'hover_bg' => __( 'Submenu Hover BG', WP_ADMINIFY_TD ),
388 'text_color' => __( 'Text Color', WP_ADMINIFY_TD ),
389 'text_hover' => __( 'Text Hover', WP_ADMINIFY_TD ),
390 'active_bg' => __( 'Active Submenu BG', WP_ADMINIFY_TD ),
391 'active_color' => __( 'Active Submenu Color', WP_ADMINIFY_TD ),
392 ),
393 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['sub_menu_colors'],
394 );
395 $menu_styles_tab[] = array(
396 'id' => 'notif_colors',
397 'type' => 'color_group',
398 'title' => __( 'Notification Colors', WP_ADMINIFY_TD ),
399 'options' => array(
400 'notif_bg' => __( 'Background', WP_ADMINIFY_TD ),
401 'notif_color' => __( 'Text Color', WP_ADMINIFY_TD ),
402 ),
403 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['notif_colors'],
404 );
405 }
406
407 public function user_info_style_tab( &$user_info_styles_tab )
408 {
409 $user_info_styles_tab[] = array(
410 'type' => 'subheading',
411 'content' => __( 'User Info Style', WP_ADMINIFY_TD ),
412 );
413 $user_info_styles_tab[] = array(
414 'type' => 'notice',
415 'title' => __( 'Link Color', WP_ADMINIFY_TD ),
416 'style' => 'warning',
417 'content' => Utils::adminify_upgrade_pro(),
418 );
419 $user_info_styles_tab[] = array(
420 'type' => 'notice',
421 'title' => __( 'Hover Color', WP_ADMINIFY_TD ),
422 'style' => 'warning',
423 'content' => Utils::adminify_upgrade_pro(),
424 );
425 $user_info_styles_tab[] = array(
426 'type' => 'notice',
427 'title' => __( 'Border', WP_ADMINIFY_TD ),
428 'style' => 'warning',
429 'content' => Utils::adminify_upgrade_pro(),
430 );
431 $user_info_styles_tab[] = array(
432 'type' => 'notice',
433 'title' => __( 'Icon Color', WP_ADMINIFY_TD ),
434 'style' => 'warning',
435 'content' => Utils::adminify_upgrade_pro(),
436 );
437 $user_info_styles_tab[] = array(
438 'type' => 'notice',
439 'title' => __( 'Hover Icon Color', WP_ADMINIFY_TD ),
440 'style' => 'warning',
441 'content' => Utils::adminify_upgrade_pro(),
442 );
443 }
444
445 public function menu_styles_tab( &$styles_tab )
446 {
447 $menu_styles_tab = [];
448 $user_info_styles_tab = [];
449 $this->menu_layout_style_tab( $menu_styles_tab );
450 $this->user_info_style_tab( $user_info_styles_tab );
451 $styles_tab[] = array(
452 'id' => 'menu_styles',
453 'type' => 'fieldset',
454 'title' => '',
455 'fields' => $menu_styles_tab,
456 );
457 $styles_tab[] = array(
458 'id' => 'user_info_style',
459 'type' => 'fieldset',
460 'title' => '',
461 'fields' => $user_info_styles_tab,
462 'dependency' => array(
463 'layout_type',
464 '==',
465 'vertical',
466 'true'
467 ),
468 );
469 }
470
471 public function menu_layout_settings()
472 {
473 if ( !class_exists( 'ADMINIFY' ) ) {
474 return;
475 }
476 $settings_tab = [];
477 $styles_tab = [];
478 $this->menu_layout_settings_tab( $settings_tab );
479 $this->menu_styles_tab( $styles_tab );
480 // Menu Layout Section
481 \ADMINIFY::createSection( $this->prefix, array(
482 'title' => __( 'Menu Settings', WP_ADMINIFY_TD ),
483 'icon' => 'fas fa-bars',
484 'fields' => array( array(
485 'type' => 'subheading',
486 'content' => Utils::adminfiy_help_urls(
487 __( 'Menu Settings', WP_ADMINIFY_TD ),
488 'https://wpadminify.com/kb/dashboard-menu-settings/',
489 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
490 'https://www.facebook.com/groups/jeweltheme',
491 'https://wpadminify.com/support/'
492 ),
493 ), array(
494 'id' => 'menu_layout_settings',
495 'type' => 'tabbed',
496 'title' => '',
497 'tabs' => array( array(
498 'title' => 'Settings',
499 'fields' => $settings_tab,
500 ), array(
501 'title' => 'Styles',
502 'fields' => $styles_tab,
503 ) ),
504 ) ),
505 ) );
506 }
507
508 }