PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 1.0.7
Adminify – White Label, Admin Menu Editor, Login Customizer v1.0.7
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
← All changes | Inc/Admin/Options/MenuLayout.php +601 -514 4.2.181.0.7 View file →
@@ -1,576 +1,663 @@
1 1 <?php
2 2
3 -namespace PXLBSAdminify\Inc\Admin\Options;
3 +namespace WPAdminify\Inc\Admin\Options;
4 4
5 -use PXLBSAdminify\Inc\Utils;
6 -use PXLBSAdminify\Inc\Admin\AdminSettingsModel;
7 -use PXLBSAdminify\Inc\Modules\MenuEditor\MenuEditor;
5 +use WPAdminify\Inc\Utils;
6 +use WPAdminify\Inc\Admin\AdminSettingsModel;
8 7
9 -if ( ! defined( 'ABSPATH' ) ) {
10 - die;
8 +if (!defined('ABSPATH')) {
9 + die;
11 10 } // Cannot access directly.
12 11
13 12
14 13
15 -class MenuLayout extends AdminSettingsModel {
14 +class MenuLayout extends AdminSettingsModel
15 +{
16 + public function __construct()
17 + {
18 + $this->menu_layout_settings();
19 + }
16 20
17 - public function __construct() {
18 - $this->menu_layout_settings();
19 - }
20 21
22 + public function get_defaults()
23 + {
24 + return [
25 + 'menu_layout_settings' => [
26 + 'layout_type' => 'vertical',
27 + 'menu_hover_submenu' => 'classic',
28 + 'active_menu_style' => 'classic',
29 + 'menu_mode' => 'classic',
30 + 'user_info' => false,
31 + 'user_info_content' => 'text',
32 + 'legacy_menu' => false,
33 + 'user_info_avatar' => 'rounded',
34 + 'horz_menu_type' => 'both',
35 + 'show_bloglink' => true,
36 + 'horz_dropdown_icon' => true,
37 + 'horz_toplinks' => false,
38 + 'horz_bubble_icon_hide' => false,
39 + 'horz_long_menu_break' => true,
40 + 'menu_styles' => [
41 + 'menu_typography' => [
42 + 'font-family' => 'Nunito Sans',
43 + 'type' => 'google'
44 + ],
45 + 'menu_wrapper_padding' => '',
46 + 'menu_vertical_padding' => '',
47 + 'horz_menu_parent_padding' => '',
48 + 'submenu_wrapper_padding' => '',
49 + 'submenu_vertical_space' => '',
50 + 'parent_menu_colors' => [
51 + 'wrap_bg' => '',
52 + 'hover_bg' => '',
53 + 'text_color' => '',
54 + 'text_hover' => '',
55 + 'active_color' => '',
56 + ],
57 + 'sub_menu_colors' => [
58 + 'wrap_bg' => '',
59 + 'hover_bg' => '',
60 + 'text_color' => '',
61 + 'text_hover' => '',
62 + 'active_bg' => '',
63 + 'active_color' => '',
64 + ],
65 + 'notif_colors' => [
66 + 'notif_bg' => '',
67 + 'notif_color' => ''
68 + ]
69 + ],
70 + 'user_info_style' => [
71 + 'info_text_color' => '',
72 + 'info_text_hover_color' => '',
73 + 'info_text_border' => [
74 + 'top' => '',
75 + 'right' => '',
76 + 'bottom' => '',
77 + 'left' => '',
78 + 'style' => 'solid',
79 + 'color' => '',
80 + ],
81 + 'info_icon_color' => '',
82 + 'info_icon_hover_color' => ''
83 + ]
84 + ]
21 85
22 - public function get_defaults() {
23 - return [
24 - 'menu_layout_settings' => [
25 - 'layout_type' => 'vertical',
26 - 'menu_hover_submenu' => 'two_step',
27 - 'icon_style' => 'classic',
28 - 'menu_mode' => 'classic',
29 - 'menu_search' => false,
30 - 'horz_menu_type' => 'both',
31 - 'horz_dropdown_icon' => true,
32 - 'horz_toplinks' => false,
33 - 'horz_bubble_icon_hide' => false,
34 - // 'horz_long_menu_break' => true,
35 - 'menu_styles' => [
36 - 'menu_typography' => [
37 - 'font-family' => 'Nunito Sans',
38 - 'type' => 'google',
39 - ],
40 - 'menu_width' => '',
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_fields' => [
67 - 'enable_user_info' => false,
68 - 'user_info_content' => 'text',
69 - 'user_info_avatar' => 'rounded',
70 - ],
71 - 'user_info_style' => [
72 - 'info_text_color' => '',
73 - 'info_text_hover_color' => '',
74 - 'info_text_border' => '',
75 - 'info_icon_color' => '',
76 - 'info_icon_hover_color' => '',
77 - ],
78 - ],
86 + ];
87 + }
79 88
80 - ];
81 - }
82 89
90 + public function menu_layout_settings_tab(&$settings_tab)
91 + {
92 + $settings_tab[] = array(
93 + 'id' => 'layout_type',
94 + 'type' => 'button_set',
95 + 'title' => __('Menu Type', WP_ADMINIFY_TD),
96 + 'options' => array(
97 + 'vertical' => __('Vertical Menu', WP_ADMINIFY_TD),
98 + 'horizontal' => __('Horizontal Menu', WP_ADMINIFY_TD),
99 + ),
100 + 'default' => $this->get_default_field('menu_layout_settings')['layout_type'],
101 + );
83 102
84 - public function menu_layout_settings_tab( &$settings_tab ) {
85 - $settings_tab[] = [
86 - 'id' => 'layout_type',
87 - 'type' => 'button_set',
88 - 'title' => __( 'Menu Type', 'adminify' ),
89 - 'options' => [
90 - 'vertical' => __( 'Vertical Menu', 'adminify' ),
91 - 'horizontal' => __( 'Horizontal Menu', 'adminify' ),
92 - ],
93 - 'default' => $this->get_default_field( 'menu_layout_settings' )['layout_type'],
94 - ];
103 + $settings_tab[] = array(
104 + 'id' => 'menu_hover_submenu',
105 + 'type' => 'button_set',
106 + 'title' => __('Sub Menu Style', WP_ADMINIFY_TD),
107 + 'options' => array(
108 + 'classic' => __('Classic', WP_ADMINIFY_TD),
109 + 'accordion' => __('Accordion', WP_ADMINIFY_TD),
110 + 'toggle' => __('Toggle', WP_ADMINIFY_TD),
111 + ),
112 + 'dependency' => array('layout_type', '==', 'vertical', 'true'),
113 + 'default' => $this->get_default_field('menu_layout_settings')['menu_hover_submenu'],
114 + );
95 115
96 - $settings_tab[] = [
97 - 'id' => 'horizontal_menu_id_notice',
98 - 'type' => 'notice',
99 - 'style' => 'warning',
100 - 'class' => 'adminify-one-col',
101 - 'content' => Utils::upgrade_pro_notice( 'Horizontal Menu Requires "Adminify UI" Enabled from "Customize" Tab ' ),
102 - 'dependency' => [ 'admin_ui|layout_type', '!=|==', 'true|horizontal', 'true' ],
103 - ];
104 116
105 - $settings_tab[] = [
106 - 'id' => 'menu_search',
107 - 'type' => 'switcher',
108 - /* translators: %s: PRO badge label */
109 - 'title' => sprintf(__('Menu Search %s', 'adminify'), Utils::upgrade_pro_badge()),
110 - 'class' => 'adminify-pro-fieldset adminify-pro-notice',
111 - 'label' => __( 'Enable or Disable Menu Search on Admin Menu', 'adminify' ),
112 - 'text_on' => __( 'Enable', 'adminify' ),
113 - 'text_off' => __( 'Disable', 'adminify' ),
114 - 'text_width' => 100,
115 - 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_search'],
116 - 'dependency' => [ 'layout_type', '==', 'vertical', 'true' ],
117 - ];
117 + $settings_tab[] = array(
118 + 'id' => 'active_menu_style',
119 + 'type' => 'button_set',
120 + 'title' => __('Active Menu Style', WP_ADMINIFY_TD),
121 + 'options' => array(
122 + 'classic' => __('Classic', WP_ADMINIFY_TD),
123 + 'rounded' => __('Rounded', WP_ADMINIFY_TD),
124 + ),
125 + 'dependency' => array('layout_type', '==', 'vertical', 'true'),
126 + 'default' => $this->get_default_field('menu_layout_settings')['active_menu_style'],
127 + );
118 128
119 - $settings_tab[] = [
120 - 'id' => 'menu_mode',
121 - 'type' => 'button_set',
122 - 'title' => __( 'Menu Mode', 'adminify' ),
123 - 'options' => [
124 - 'classic' => __( 'Default', 'adminify' ),
125 - 'icon_menu' => __( 'Folded', 'adminify' ),
126 - 'rounded' => __( 'Rounded', 'adminify' ),
127 - ],
128 - 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_mode'],
129 - 'dependency' => [ 'layout_type', '==', 'vertical', 'true' ],
130 - ];
131 129
132 - $settings_tab[] = [
133 - 'id' => 'rounded_menu_notice',
134 - 'type' => 'notice',
135 - 'style' => 'warning',
136 - 'class' => 'adminify-one-col',
137 - 'content' => Utils::upgrade_pro_notice( 'Rounded Menu Mode Requires "Adminify UI" Module Enabled from "Adminify>Customize" Menu ' ),
138 - 'dependency' => [ 'admin_ui|layout_type|menu_mode', '!=|==|==', 'true|vertical|rounded', 'true' ],
139 - ];
130 + if (!jltwp_adminify()->can_use_premium_code__premium_only()) {
131 + $settings_tab[] = array(
132 + 'type' => 'notice',
133 + 'title' => __('Horizontal Menu', WP_ADMINIFY_TD),
134 + 'style' => 'warning',
135 + 'content' => Utils::adminify_upgrade_pro(),
136 + 'dependency' => array('layout_type', '==', 'horizontal', 'true'),
137 + );
138 + }
140 139
141 - $settings_tab[] = [
142 - 'id' => 'icon_style',
143 - 'type' => 'button_set',
144 - 'title' => __( 'Icon Style', 'adminify' ),
145 - 'options' => [
146 - 'classic' => __( 'Default', 'adminify' ),
147 - 'rounded' => __( 'Rounded', 'adminify' ),
148 - ],
149 - 'dependency' => [ 'admin_ui|layout_type|menu_mode', '==|==|==', 'true|vertical|icon_menu', 'true' ],
150 - 'default' => $this->get_default_field( 'menu_layout_settings' )['icon_style'],
151 - ];
140 + $settings_tab[] = array(
141 + 'id' => 'menu_mode',
142 + 'type' => 'button_set',
143 + 'title' => __('Menu Mode', WP_ADMINIFY_TD),
144 + 'options' => array(
145 + 'classic' => __('Classic', WP_ADMINIFY_TD),
146 + 'icon_menu' => __('Mini Icon', WP_ADMINIFY_TD),
147 + 'rounded' => __('Rounded', WP_ADMINIFY_TD),
148 + ),
149 + 'default' => $this->get_default_field('menu_layout_settings')['menu_mode'],
150 + 'dependency' => array('layout_type', '==', 'vertical', 'true'),
151 + );
152 152
153 - $settings_tab[] = [
154 - 'id' => 'menu_hover_submenu',
155 - 'type' => 'button_set',
156 - 'title' => __( 'Sub Menu Style', 'adminify' ),
157 - 'options' => [
158 - 'two_step' => __( 'Two Step', 'adminify' ),
159 - 'accordion' => __( 'Accordion', 'adminify' ),
160 - 'toggle' => __( 'Toggle', 'adminify' ),
161 - ],
162 - 'dependency' => [ 'layout_type', '==', 'vertical', 'true' ],
163 - 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_hover_submenu'],
164 - ];
153 + if (jltwp_adminify()->can_use_premium_code__premium_only()) {
154 + $settings_tab[] = array(
155 + 'id' => 'user_info',
156 + 'type' => 'switcher',
157 + 'title' => __('User Info', WP_ADMINIFY_TD),
158 + 'label' => __('Enable/Disable User Info on Admin Menu', WP_ADMINIFY_TD),
159 + 'text_on' => __('Show', WP_ADMINIFY_TD),
160 + 'text_off' => __('Hide', WP_ADMINIFY_TD),
161 + 'text_width' => 100,
162 + 'default' => $this->get_default_field('menu_layout_settings')['user_info'],
163 + 'dependency' => array('layout_type', '==', 'vertical', 'true'),
164 + );
165 + } else {
166 + $settings_tab[] = array(
167 + 'type' => 'notice',
168 + 'title' => __('User Info', WP_ADMINIFY_TD),
169 + 'style' => 'warning',
170 + 'content' => Utils::adminify_upgrade_pro(),
171 + 'dependency' => array('layout_type', '==', 'vertical', 'true'),
172 + );
173 + }
165 174
166 - $settings_tab[] = [
167 - 'id' => 'two_step_menu_notice',
168 - 'type' => 'notice',
169 - 'style' => 'warning',
170 - 'class' => 'adminify-one-col',
171 - 'content' => Utils::upgrade_pro_notice( 'Two Step Menu Requires "Adminify UI" Module Enabled from "Adminify>Customize" Menu ' ),
172 - 'dependency' => [ 'admin_ui|layout_type|menu_hover_submenu', '!=|==|==', 'true|vertical|two_step', 'true' ],
173 - ];
174 175
175 - $settings_tab[] = [
176 - 'id' => 'accordion_menu_notice',
177 - 'type' => 'notice',
178 - 'style' => 'warning',
179 - 'class' => 'adminify-one-col',
180 - 'content' => Utils::upgrade_pro_notice( 'Accordion Menu Requires "Adminify UI" Module Enabled from "Adminify>Customize" Menu ' ),
181 - 'dependency' => [ 'admin_ui|layout_type|menu_hover_submenu', '!=|==|==', 'true|vertical|accordion', 'true' ],
182 - ];
176 + $settings_tab[] = array(
177 + 'id' => 'user_info_content',
178 + 'type' => 'button_set',
179 + 'title' => __('Content Type', WP_ADMINIFY_TD),
180 + 'options' => array(
181 + 'text' => __('Text', WP_ADMINIFY_TD),
182 + 'icon' => __('Icon', WP_ADMINIFY_TD),
183 + ),
184 + 'default' => $this->get_default_field('menu_layout_settings')['user_info_content'],
185 + 'dependency' => array('user_info|layout_type', '==|==', 'true|vertical', 'true'),
186 + );
187 + $settings_tab[] = array(
188 + 'id' => 'user_info_avatar',
189 + 'type' => 'button_set',
190 + 'title' => __('Avatar Type', WP_ADMINIFY_TD),
191 + 'options' => array(
192 + 'rounded' => __('Rounded', WP_ADMINIFY_TD),
193 + 'square' => __('Square', WP_ADMINIFY_TD),
194 + ),
195 + 'default' => $this->get_default_field('menu_layout_settings')['user_info_avatar'],
196 + 'dependency' => array('user_info|layout_type', '==|==', 'true|vertical', 'true'),
197 + );
183 198
184 - $settings_tab[] = [
185 - 'id' => 'toggle_menu_notice',
186 - 'type' => 'notice',
187 - 'style' => 'warning',
188 - 'class' => 'adminify-one-col',
189 - 'content' => Utils::upgrade_pro_notice( 'Toggle Menu Requires "Adminify UI" Module Enabled from "Adminify>Customize" Menu ' ),
190 - 'dependency' => [ 'admin_ui|layout_type|menu_hover_submenu', '!=|==|==', 'true|vertical|toggle', 'true' ],
191 - ];
199 + // array(
200 + // 'id' => 'legacy_menu',
201 + // 'type' => 'switcher',
202 + // 'title' => 'Default Menu',
203 + // 'label' => 'Enable for Legacy WordPress default menu',
204 + // 'text_on' => 'Enabled',
205 + // 'text_off' => 'Disabled',
206 + // 'text_width' => 100,
207 + // 'dependency' => array('layout_type', '==', 'vertical', 'true'),
208 + // ),
192 209
193 - // $settings_tab[] = [
194 - // 'id' => 'horizontal_menu_notice',
195 - // 'type' => 'notice',
196 - // 'title' => __( 'Horizontal Menu', 'adminify' ),
197 - // 'style' => 'warning',
198 - // 'content' => Utils::upgrade_pro_notice(),
199 - // 'dependency' => [ 'admin_ui|layout_type', '==|==', 'true|horizontal', 'true' ],
200 - // ];
210 + if (jltwp_adminify()->can_use_premium_code__premium_only()) {
201 211
212 + $settings_tab[] = array(
213 + 'id' => 'horz_menu_type',
214 + 'type' => 'button_set',
215 + 'title' => __('Menu Type', WP_ADMINIFY_TD),
216 + 'options' => array(
217 + 'icons_only' => __('Icon Only', WP_ADMINIFY_TD),
218 + 'text_only' => __('Text Only', WP_ADMINIFY_TD),
219 + 'both' => __('Both', WP_ADMINIFY_TD),
220 + ),
221 + 'default' => $this->get_default_field('menu_layout_settings')['horz_menu_type'],
222 + 'dependency' => array('layout_type', '==', 'horizontal', 'true'),
223 + );
224 + } else {
225 + $settings_tab[] = array(
226 + 'type' => 'notice',
227 + 'title' => __('Menu Type', WP_ADMINIFY_TD),
228 + 'style' => 'warning',
229 + 'content' => Utils::adminify_upgrade_pro(),
230 + 'dependency' => array('layout_type', '==', 'horizontal', 'true'),
231 + );
232 + }
202 233
203 - $settings_tab[] = [
204 - 'id' => 'horizontal_menu_notice',
205 - 'type' => 'notice',
206 - 'style' => 'warning',
207 - 'title' => ' ',
208 - // 'class' => 'adminify-one-col',
209 - 'content' => Utils::upgrade_pro_notice( '<strong>Horizontal Menu is available in PRO version</strong>' ),
210 - 'dependency' => [ 'admin_ui|layout_type', '==|==', 'true|horizontal', 'true' ],
211 - ];
212 234
213 - $settings_tab[] = [
214 - 'id' => 'user_info_fields',
215 - 'type' => 'fieldset',
216 - /* translators: %s: PRO badge label */
217 - 'title' => sprintf(__('User Info %s', 'adminify'), Utils::upgrade_pro_badge()),
218 - 'dependency' => [ 'admin_ui|layout_type', '==|==', 'true|vertical', 'true' ],
219 - 'fields' => [
220 - [
221 - 'id' => 'enable_user_info', // user_info
222 - 'type' => 'switcher',
223 - 'class' => 'adminify-pt-0 adminify-pl-0 !adminify-flex adminify-pro-feature',
224 - 'label' => __( 'Show or Hide User Info with Avatar on Admin Menu', 'adminify' ),
225 - 'text_on' => __( 'Show', 'adminify' ),
226 - 'text_off' => __( 'Hide', 'adminify' ),
227 - 'text_width' => 100,
228 - 'default' => $this->get_default_field( 'menu_layout_settings' )['user_info_fields']['enable_user_info'],
235 + if (jltwp_adminify()->can_use_premium_code__premium_only()) {
236 + $settings_tab[] = array(
237 + 'id' => 'show_bloglink',
238 + 'type' => 'switcher',
239 + 'title' => __('Show Blog Link', WP_ADMINIFY_TD),
240 + 'label' => __('Show Blog Site Link on beginning', WP_ADMINIFY_TD),
241 + 'text_on' => __('Show', WP_ADMINIFY_TD),
242 + 'text_off' => __('Hide', WP_ADMINIFY_TD),
243 + 'text_width' => 100,
244 + 'default' => $this->get_default_field('menu_layout_settings')['show_bloglink'],
245 + 'dependency' => array('layout_type', '==', 'horizontal', 'true'),
246 + );
247 + } else {
248 + $settings_tab[] = array(
249 + 'type' => 'notice',
250 + 'title' => __('Show Blog Link', WP_ADMINIFY_TD),
251 + 'style' => 'warning',
252 + 'content' => Utils::adminify_upgrade_pro(),
253 + 'dependency' => array('layout_type', '==', 'horizontal', 'true'),
254 + );
255 + }
229 256
230 - ],
231 - [
232 - 'id' => 'user_info_content',
233 - 'type' => 'button_set',
234 - 'class' => Utils::upgrade_pro_notice_class(),
235 - 'title' => __( 'Content Type', 'adminify' ),
236 - 'options' => [
237 - 'text' => __( 'Text', 'adminify' ),
238 - 'icon' => __( 'Icon', 'adminify' ),
239 - ],
240 - 'default' => $this->get_default_field( 'menu_layout_settings' )['user_info_fields']['user_info_content'],
241 - 'dependency' => [ 'enable_user_info|layout_type', '==|==', 'true|vertical', 'true' ],
242 - ],
243 - [
244 - 'id' => 'user_info_avatar',
245 - 'type' => 'button_set',
246 - 'class' => Utils::upgrade_pro_notice_class(),
247 - 'title' => __( 'Avatar Type', 'adminify' ),
248 - 'options' => [
249 - 'rounded' => __( 'Rounded', 'adminify' ),
250 - 'square' => __( 'Square', 'adminify' ),
251 - ],
252 - 'default' => $this->get_default_field( 'menu_layout_settings' )['user_info_fields']['user_info_avatar'],
253 - 'dependency' => [ 'enable_user_info|layout_type', '==|==', 'true|vertical', 'true' ],
254 - ]
255 - ]
256 - ];
257 + if (jltwp_adminify()->can_use_premium_code__premium_only()) {
258 + $settings_tab[] = array(
259 + 'id' => 'horz_dropdown_icon',
260 + 'type' => 'switcher',
261 + 'title' => __('Dropdown Toggle Icon', WP_ADMINIFY_TD),
262 + 'label' => __('Show/Hide Dropdown Icon', WP_ADMINIFY_TD),
263 + 'text_on' => __('Show', WP_ADMINIFY_TD),
264 + 'text_off' => __('Hide', WP_ADMINIFY_TD),
265 + 'text_width' => 100,
266 + 'default' => $this->get_default_field('menu_layout_settings')['horz_dropdown_icon'],
267 + 'dependency' => array('layout_type', '==', 'horizontal', 'true'),
268 + );
269 + } else {
270 + $settings_tab[] = array(
271 + 'type' => 'notice',
272 + 'title' => __('Dropdown Toggle Icon', WP_ADMINIFY_TD),
273 + 'style' => 'warning',
274 + 'content' => Utils::adminify_upgrade_pro(),
275 + 'dependency' => array('layout_type', '==', 'horizontal', 'true'),
276 + );
277 + }
257 278
258 - $settings_tab[] = [
259 - 'id' => 'horz_menu_type',
260 - 'type' => 'button_set',
261 - 'class' => 'adminify-pro-fieldset',
262 - /* translators: %s: PRO badge label */
263 - 'title' => sprintf(__('Menu Item Style %s', 'adminify'), Utils::upgrade_pro_badge()),
264 - 'options' => [
265 - 'icons_only' => __( 'Icon Only', 'adminify' ),
266 - 'text_only' => __( 'Text Only', 'adminify' ),
267 - 'both' => __( 'Both', 'adminify' ),
268 - ],
269 - 'default' => $this->get_default_field( 'menu_layout_settings' )['horz_menu_type'],
270 - 'dependency' => [ 'admin_ui|layout_type', '==|==', 'true|horizontal', 'true' ],
271 - ];
279 + if (jltwp_adminify()->can_use_premium_code__premium_only()) {
280 + $settings_tab[] = array(
281 + 'id' => 'horz_toplinks',
282 + 'type' => 'switcher',
283 + 'title' => __('Top Menu Links', WP_ADMINIFY_TD),
284 + 'label' => __('Parent/Top Menu Links clickable', WP_ADMINIFY_TD),
285 + 'text_on' => __('Enabled', WP_ADMINIFY_TD),
286 + 'text_off' => __('Disabled', WP_ADMINIFY_TD),
287 + 'text_width' => 100,
288 + 'default' => $this->get_default_field('menu_layout_settings')['horz_toplinks'],
289 + 'dependency' => array('layout_type', '==', 'horizontal', 'true'),
290 + );
291 + } else {
292 + $settings_tab[] = array(
293 + 'type' => 'notice',
294 + 'title' => __('Top Menu Links', WP_ADMINIFY_TD),
295 + 'style' => 'warning',
296 + 'content' => Utils::adminify_upgrade_pro(),
297 + 'dependency' => array('layout_type', '==', 'horizontal', 'true'),
298 + );
299 + }
272 300
273 - $settings_tab[] = [
274 - 'id' => 'horz_dropdown_icon',
275 - 'type' => 'switcher',
276 - 'class' => 'adminify-pro-fieldset adminify-pro-notice',
277 - /* translators: %s: PRO badge label */
278 - 'title' => sprintf(__('Dropdown Toggle Icon %s', 'adminify'), Utils::upgrade_pro_badge()),
279 - 'label' => __( 'Show/Hide Dropdown Icon', 'adminify' ),
280 - 'text_on' => __( 'Show', 'adminify' ),
281 - 'text_off' => __( 'Hide', 'adminify' ),
282 - 'text_width' => 100,
283 - 'default' => $this->get_default_field( 'menu_layout_settings' )['horz_dropdown_icon'],
284 - 'dependency' => [ 'admin_ui|layout_type', '==|==', 'true|horizontal', 'true' ],
285 - ];
286 301
287 - $settings_tab[] = [
288 - 'id' => 'horz_toplinks',
289 - 'type' => 'switcher',
290 - 'class' => 'adminify-pro-fieldset adminify-pro-notice',
291 - /* translators: %s: PRO badge label */
292 - 'title' => sprintf(__('Top Menu Links %s', 'adminify'), Utils::upgrade_pro_badge()),
293 - 'label' => __( 'Parent/Top Menu Links clickable', 'adminify' ),
294 - 'text_on' => __( 'Enabled', 'adminify' ),
295 - 'text_off' => __( 'Disabled', 'adminify' ),
296 - 'text_width' => 100,
297 - 'default' => $this->get_default_field( 'menu_layout_settings' )['horz_toplinks'],
298 - 'dependency' => [ 'admin_ui|layout_type', '==|==', 'true|horizontal', 'true' ],
299 - ];
302 + if (jltwp_adminify()->can_use_premium_code__premium_only()) {
303 + $settings_tab[] = array(
304 + 'id' => 'horz_bubble_icon_hide',
305 + 'type' => 'switcher',
306 + 'title' => __('Bubble Icon', WP_ADMINIFY_TD),
307 + 'label' => __('Show/Hide Update or Plugins Bubble Icon', WP_ADMINIFY_TD),
308 + 'text_on' => __('Show', WP_ADMINIFY_TD),
309 + 'text_off' => __('Hide', WP_ADMINIFY_TD),
310 + 'text_width' => 100,
311 + 'default' => $this->get_default_field('menu_layout_settings')['horz_bubble_icon_hide'],
312 + 'dependency' => array('layout_type', '==', 'horizontal', 'true'),
313 + );
314 + } else {
315 + $settings_tab[] = array(
316 + 'type' => 'notice',
317 + 'title' => __('Bubble Icon', WP_ADMINIFY_TD),
318 + 'style' => 'warning',
319 + 'content' => Utils::adminify_upgrade_pro(),
320 + 'dependency' => array('layout_type', '==', 'horizontal', 'true'),
321 + );
322 + }
300 323
301 - $settings_tab[] = [
302 - 'id' => 'horz_bubble_icon_hide',
303 - 'type' => 'switcher',
304 - 'class' => 'adminify-pro-fieldset adminify-pro-notice',
305 - /* translators: %s: PRO badge label */
306 - 'title' => sprintf(__('Bubble Icon %s', 'adminify'), Utils::upgrade_pro_badge()),
307 - 'label' => __( 'Show/Hide Update or Plugins Bubble Icon', 'adminify' ),
308 - 'text_on' => __( 'Show', 'adminify' ),
309 - 'text_off' => __( 'Hide', 'adminify' ),
310 - 'text_width' => 100,
311 - 'default' => $this->get_default_field( 'menu_layout_settings' )['horz_bubble_icon_hide'],
312 - 'dependency' => [ 'admin_ui|layout_type', '==|==', 'true|horizontal', 'true' ],
313 - ];
314 324
315 - // $settings_tab[] = [
316 - // 'id' => 'horz_long_menu_break',
317 - // 'type' => 'switcher',
318 - // 'class' => 'adminify-pro-fieldset adminify-pro-notice',
319 - // 'title' => __( 'Break Long Lists', 'adminify' ),
320 - // 'title' => sprintf(__('Break Long Lists %s', 'adminify'), Utils::upgrade_pro_badge()),
321 - // 'label' => __( 'Break Menu Lines if Main menu gets longer lists and doesn\'t cover screen witdh', 'adminify' ),
322 - // 'text_on' => __( 'Enable', 'adminify' ),
323 - // 'text_off' => __( 'Disable', 'adminify' ),
324 - // 'text_width' => 100,
325 - // 'default' => $this->get_default_field( 'menu_layout_settings' )['horz_long_menu_break'],
326 - // 'dependency' => [ 'admin_ui|layout_type', '==|==', 'true|horizontal', 'true' ],
327 - // ];
325 + if (jltwp_adminify()->can_use_premium_code__premium_only()) {
326 + $settings_tab[] = array(
327 + 'id' => 'horz_long_menu_break',
328 + 'type' => 'switcher',
329 + 'title' => __('Break Long Lists', WP_ADMINIFY_TD),
330 + 'label' => __('Break Menu Lines if Main menu gets longer lists and doesn\'t cover screen witdh', WP_ADMINIFY_TD),
331 + 'text_on' => __('Enable', WP_ADMINIFY_TD),
332 + 'text_off' => __('Disable', WP_ADMINIFY_TD),
333 + 'text_width' => 100,
334 + 'default' => $this->get_default_field('menu_layout_settings')['horz_long_menu_break'],
335 + 'dependency' => array('layout_type', '==', 'horizontal', 'true'),
336 + );
337 + } else {
338 + $settings_tab[] = array(
339 + 'type' => 'notice',
340 + 'title' => __('Break Long Lists', WP_ADMINIFY_TD),
341 + 'style' => 'warning',
342 + 'content' => Utils::adminify_upgrade_pro(),
343 + 'dependency' => array('layout_type', '==', 'horizontal', 'true'),
344 + );
345 + }
346 + }
328 347
329 - }
330 348
331 349
332 350
351 + public function menu_layout_style_tab(&$menu_styles_tab)
352 + {
353 + $menu_styles_tab[] = array(
354 + 'type' => 'subheading',
355 + 'content' => __('Menu Styles', WP_ADMINIFY_TD),
356 + );
357 + $menu_styles_tab[] = array(
358 + 'id' => 'menu_typography',
359 + 'type' => 'typography',
360 + 'title' => __('Font Settings', WP_ADMINIFY_TD),
361 + 'font_family' => true,
362 + 'font_weight' => true,
363 + 'font_style' => true,
364 + 'font_size' => true,
365 + 'line_height' => true,
366 + 'letter_spacing' => true,
367 + 'text_align' => true,
368 + 'text-transform' => true,
369 + 'color' => false,
370 + 'subset' => false,
371 + 'backup_font_family' => false,
372 + 'font_variant' => false,
373 + 'word_spacing' => false,
374 + 'text_decoration' => false,
375 + 'default' => $this->get_default_field('menu_layout_settings')['menu_styles']['menu_typography'],
376 + );
333 377
334 - public function menu_layout_style_tab( &$menu_styles_tab ) {
335 - // $menu_styles_tab[] = [
336 - // 'type' => 'subheading',
337 - // 'content' => __( 'Menu Styles', 'adminify' ),
338 - // ];
378 + $menu_styles_tab[] = array(
379 + 'id' => 'menu_wrapper_padding',
380 + 'type' => 'spacing',
381 + 'title' => __('Menu Wrapper Padding', WP_ADMINIFY_TD),
382 + 'default' => $this->get_default_field('menu_layout_settings')['menu_styles']['menu_wrapper_padding'],
383 + );
339 384
340 - $menu_styles_tab[] = [
341 - 'id' => 'menu_typography',
342 - 'type' => 'typography',
343 - 'title' => __( 'Font Settings', 'adminify' ),
344 - 'font_family' => false,
345 - 'font_weight' => true,
346 - 'font_style' => true,
347 - 'font_size' => true,
348 - 'line_height' => true,
349 - 'letter_spacing' => true,
350 - 'text_align' => false,
351 - 'text_transform' => false,
352 - 'color' => false,
353 - 'subset' => false,
354 - 'backup_font_family' => false,
355 - 'font_variant' => false,
356 - 'word_spacing' => false,
357 - 'text_decoration' => false,
358 - 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['menu_typography'],
359 - ];
360 -
361 - $menu_styles_tab[] = [
362 - 'id' => 'menu_width',
363 - 'type' => 'dimensions',
364 - 'title' => __( 'Menu Width', 'adminify' ),
365 - 'height' => false,
366 - 'units' => array('px'),
367 - 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['menu_width'],
368 - ];
369 -
370 - $menu_styles_tab[] = [
371 - 'id' => 'menu_wrapper_padding',
372 - 'type' => 'spacing',
373 - 'title' => __( 'Menu Wrapper Padding', 'adminify' ),
374 - 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['menu_wrapper_padding'],
375 - ];
376 -
377 - $menu_styles_tab[] = [
378 - 'id' => 'menu_vertical_padding',
379 - 'type' => 'slider',
380 - 'title' => __( 'Parent Menu Vertical Padding', 'adminify' ),
381 - 'unit' => 'px',
382 - 'min' => 1,
383 - 'max' => 100,
384 - 'step' => 1,
385 - 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['menu_vertical_padding'],
386 - 'dependency' => [ 'layout_type', '==', 'vertical', 'true' ],
387 - ];
388 -
389 - $menu_styles_tab[] = [
390 - 'id' => 'horz_menu_parent_padding',
385 + $menu_styles_tab[] = array(
386 + 'id' => 'menu_vertical_padding',
391 387 'type' => 'slider',
392 - 'class' => 'adminify-pro-fieldset adminify-pro-notice',
393 - /* translators: %s: PRO badge label */
394 - 'title' => sprintf(__('Parent Menu Horizontal Padding %s', 'adminify'), Utils::upgrade_pro_badge()),
388 + 'title' => __('Parent Menu Vertical Padding', WP_ADMINIFY_TD),
395 389 'unit' => 'px',
396 390 'min' => 1,
397 391 'max' => 100,
398 392 'step' => 1,
399 - 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['horz_menu_parent_padding'],
400 - 'dependency' => [ 'admin_ui|layout_type', '==|==', 'true|horizontal', 'true' ],
401 - ];
393 + 'default' => $this->get_default_field('menu_layout_settings')['menu_styles']['menu_vertical_padding'],
394 + 'dependency' => array('layout_type', '==', 'vertical', 'true'),
395 + );
402 396
403 - $menu_styles_tab[] = [
404 - 'id' => 'submenu_wrapper_padding',
405 - 'type' => 'spacing',
406 - 'title' => __( 'Sub Menu Wrapper Padding', 'adminify' ),
407 - 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['submenu_wrapper_padding'],
408 - ];
409 397
410 - $menu_styles_tab[] = [
411 - 'id' => 'submenu_vertical_space',
412 - 'type' => 'slider',
413 - 'title' => __( 'Sub Menu Vertical Padding', 'adminify' ),
414 - 'unit' => 'px',
415 - 'min' => 1,
416 - 'max' => 100,
417 - 'step' => 1,
418 - 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['submenu_vertical_space'],
419 - ];
398 + if (jltwp_adminify()->can_use_premium_code__premium_only()) {
399 + $menu_styles_tab[] = array(
400 + 'id' => 'horz_menu_parent_padding',
401 + 'type' => 'slider',
402 + 'title' => __('Parent Menu Horizontal Padding', WP_ADMINIFY_TD),
403 + 'unit' => 'px',
404 + 'min' => 1,
405 + 'max' => 100,
406 + 'step' => 1,
407 + 'default' => $this->get_default_field('menu_layout_settings')['menu_styles']['horz_menu_parent_padding'],
408 + 'dependency' => array('layout_type', '==', 'horizontal', 'true'),
409 + );
410 + } else {
411 + $menu_styles_tab[] = array(
412 + 'type' => 'notice',
413 + 'title' => __('Parent Menu Horizontal Padding', WP_ADMINIFY_TD),
414 + 'style' => 'warning',
415 + 'content' => Utils::adminify_upgrade_pro(),
416 + 'dependency' => array('layout_type', '==', 'horizontal', 'true'),
417 + );
418 + }
420 419
421 - $menu_styles_tab[] = [
422 - 'id' => 'admin_menu_color_sub',
423 - 'type' => 'subheading',
424 - 'content' => __( 'Color Settings', 'adminify' ),
425 - ];
420 + $menu_styles_tab[] = array(
421 + 'id' => 'submenu_wrapper_padding',
422 + 'type' => 'spacing',
423 + 'title' => __('Sub Menu Wrapper Padding', WP_ADMINIFY_TD),
424 + 'default' => $this->get_default_field('menu_layout_settings')['menu_styles']['submenu_wrapper_padding'],
425 + );
426 426
427 - $menu_styles_tab[] = [
428 - 'id' => 'parent_menu_colors',
429 - 'type' => 'color_group',
430 - 'title' => __( 'Parent Menu Colors', 'adminify' ),
431 - 'options' => [
432 - 'wrap_bg' => __( 'Wrap BG', 'adminify' ),
433 - 'hover_bg' => __( 'Menu Hover BG', 'adminify' ),
434 - 'text_color' => __( 'Text Color', 'adminify' ),
435 - 'text_hover' => __( 'Text Hover', 'adminify' ),
436 - 'active_bg' => __( 'Active Menu BG', 'adminify' ),
437 - 'active_color' => __( 'Active Menu Color', 'adminify' ),
438 - ],
439 - 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['parent_menu_colors'],
440 - ];
427 + $menu_styles_tab[] = array(
428 + 'id' => 'submenu_vertical_space',
429 + 'type' => 'slider',
430 + 'title' => __('Sub Menu Vertical Padding', WP_ADMINIFY_TD),
431 + 'unit' => 'px',
432 + 'min' => 1,
433 + 'max' => 100,
434 + 'step' => 1,
435 + 'default' => $this->get_default_field('menu_layout_settings')['menu_styles']['submenu_vertical_space'],
436 + );
441 437
442 - $menu_styles_tab[] = [
443 - 'id' => 'sub_menu_colors',
444 - 'type' => 'color_group',
445 - 'title' => __( 'Sub Menu Colors', 'adminify' ),
446 - 'options' => [
447 - 'wrap_bg' => __( 'Wrap BG', 'adminify' ),
448 - 'hover_bg' => __( 'Submenu Hover BG', 'adminify' ),
449 - 'text_color' => __( 'Text Color', 'adminify' ),
450 - 'text_hover' => __( 'Text Hover', 'adminify' ),
451 - 'active_bg' => __( 'Active Submenu BG', 'adminify' ),
452 - 'active_color' => __( 'Active Submenu Color', 'adminify' ),
453 - ],
454 - 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['sub_menu_colors'],
455 - ];
456 438
457 - $menu_styles_tab[] = [
458 - 'id' => 'notif_colors',
459 - 'type' => 'color_group',
460 - 'title' => __( 'Notification Colors', 'adminify' ),
461 - 'options' => [
462 - 'notif_bg' => __( 'Background', 'adminify' ),
463 - 'notif_color' => __( 'Text Color', 'adminify' ),
464 - ],
465 - 'default' => $this->get_default_field( 'menu_layout_settings' )['menu_styles']['notif_colors'],
466 - ];
467 - }
439 + $menu_styles_tab[] = array(
440 + 'type' => 'subheading',
441 + 'content' => __('Color Settings', WP_ADMINIFY_TD),
442 + );
468 443
444 + $menu_styles_tab[] = array(
445 + 'id' => 'parent_menu_colors',
446 + 'type' => 'color_group',
447 + 'title' => __('Parent Menu Colors', WP_ADMINIFY_TD),
448 + 'options' => array(
449 + 'wrap_bg' => __('Wrap BG', WP_ADMINIFY_TD),
450 + 'hover_bg' => __('Menu Hover BG', WP_ADMINIFY_TD),
451 + 'text_color' => __('Text Color', WP_ADMINIFY_TD),
452 + 'text_hover' => __('Text Hover', WP_ADMINIFY_TD),
453 + 'active_bg' => __('Active Menu BG', WP_ADMINIFY_TD),
454 + 'active_color' => __('Active Menu Color', WP_ADMINIFY_TD),
455 + ),
456 + 'default' => $this->get_default_field('menu_layout_settings')['menu_styles']['parent_menu_colors'],
457 + );
458 + $menu_styles_tab[] = array(
459 + 'id' => 'sub_menu_colors',
460 + 'type' => 'color_group',
461 + 'title' => __('Sub Menu Colors', WP_ADMINIFY_TD),
462 + 'options' => array(
463 + 'wrap_bg' => __('Wrap BG', WP_ADMINIFY_TD),
464 + 'hover_bg' => __('Submenu Hover BG', WP_ADMINIFY_TD),
465 + 'text_color' => __('Text Color', WP_ADMINIFY_TD),
466 + 'text_hover' => __('Text Hover', WP_ADMINIFY_TD),
467 + 'active_bg' => __('Active Submenu BG', WP_ADMINIFY_TD),
468 + 'active_color' => __('Active Submenu Color', WP_ADMINIFY_TD),
469 + ),
470 + 'default' => $this->get_default_field('menu_layout_settings')['menu_styles']['sub_menu_colors'],
471 + );
472 + $menu_styles_tab[] = array(
473 + 'id' => 'notif_colors',
474 + 'type' => 'color_group',
475 + 'title' => __('Notification Colors', WP_ADMINIFY_TD),
476 + 'options' => array(
477 + 'notif_bg' => __('Background', WP_ADMINIFY_TD),
478 + 'notif_color' => __('Text Color', WP_ADMINIFY_TD),
479 + ),
480 + 'default' => $this->get_default_field('menu_layout_settings')['menu_styles']['notif_colors'],
481 + );
482 + }
469 483
470 - public function menu_styles_tab( &$styles_tab ) {
471 - $menu_styles_tab = [];
472 - // $user_info_styles_tab = [];
473 - $this->menu_layout_style_tab( $menu_styles_tab );
474 - // $this->user_info_style_tab( $user_info_styles_tab );
475 484
476 - $styles_tab[] = [
477 - 'id' => 'menu_styles',
478 - 'type' => 'fieldset',
479 - 'title' => '',
480 - 'class' => 'adminify-one-col',
481 - 'fields' => $menu_styles_tab,
482 - ];
483 485
484 - $styles_tab[] = [
485 - 'id' => 'user_info_style',
486 - 'type' => 'color_group',
487 - 'class' => 'adminify-pro-fieldset',
488 - /* translators: %s: PRO badge label */
489 - 'title' => sprintf(__('User Info Colors %s', 'adminify'), Utils::upgrade_pro_badge()),
490 - 'options' => [
491 - 'info_text_color' => __('Link Color', 'adminify'),
492 - 'info_text_hover_color' => __('Hover Color', 'adminify'),
493 - 'info_text_border' => __('Border', 'adminify'),
494 - 'info_icon_color' => __('Icon Color', 'adminify'),
495 - 'info_icon_hover_color' => __('Hover Icon Color', 'adminify'),
496 - ],
497 - 'dependency' => ['layout_type|enable_user_info', '==|==', 'vertical|true', 'true'
498 - ],
499 - ];
500 - }
486 + public function user_info_style_tab(&$user_info_styles_tab)
487 + {
488 + $user_info_styles_tab[] = array(
489 + 'type' => 'subheading',
490 + 'content' => __('User Info Style', WP_ADMINIFY_TD),
491 + );
501 492
502 - /**
503 - * Menu Editor Root
504 - */
505 - public static function menu_editor_contents() {
506 - $menu_editor = MenuEditor::get_instance();
507 - $menu_editor->menu_editor_contents();
508 - }
493 + if (jltwp_adminify()->can_use_premium_code__premium_only()) {
494 + $user_info_styles_tab[] = array(
495 + 'id' => 'info_text_color',
496 + 'type' => 'color',
497 + 'title' => __('Link Color', WP_ADMINIFY_TD),
498 + 'default' => $this->get_default_field('menu_layout_settings')['user_info_style']['info_text_color'],
499 + 'dependency' => array('user_info_content', '==', 'text', 'true'),
500 + );
501 + } else {
502 + $user_info_styles_tab[] = array(
503 + 'type' => 'notice',
504 + 'title' => __('Link Color', WP_ADMINIFY_TD),
505 + 'style' => 'warning',
506 + 'content' => Utils::adminify_upgrade_pro()
507 + );
508 + }
509 509
510 + if (jltwp_adminify()->can_use_premium_code__premium_only()) {
511 + $user_info_styles_tab[] = array(
512 + 'id' => 'info_text_hover_color',
513 + 'type' => 'color',
514 + 'title' => __('Hover Color', WP_ADMINIFY_TD),
515 + 'default' => $this->get_default_field('menu_layout_settings')['user_info_style']['info_text_hover_color'],
516 + 'dependency' => array('user_info_content', '==', 'text', 'true'),
517 + );
518 + } else {
519 + $user_info_styles_tab[] = array(
520 + 'type' => 'notice',
521 + 'title' => __('Hover Color', WP_ADMINIFY_TD),
522 + 'style' => 'warning',
523 + 'content' => Utils::adminify_upgrade_pro()
524 + );
525 + }
510 526
511 - /**
512 - * Menu Layout Settings
513 - */
514 - public function menu_layout_settings() {
515 - if ( ! class_exists( 'ADMINIFY' ) ) {
516 - return;
517 - }
527 + if (jltwp_adminify()->can_use_premium_code__premium_only()) {
528 + $user_info_styles_tab[] = array(
529 + 'id' => 'info_text_border',
530 + 'type' => 'border',
531 + 'title' => __('Border', WP_ADMINIFY_TD),
532 + 'all' => true,
533 + 'default' => $this->get_default_field('menu_layout_settings')['user_info_style']['info_text_border'],
534 + 'dependency' => array('user_info_content', '==', 'text', 'true'),
535 + );
536 + } else {
537 + $user_info_styles_tab[] = array(
538 + 'type' => 'notice',
539 + 'title' => __('Border', WP_ADMINIFY_TD),
540 + 'style' => 'warning',
541 + 'content' => Utils::adminify_upgrade_pro()
542 + );
543 + }
518 544
519 - $settings_tab = [];
520 - $styles_tab = [];
521 545
522 - $this->menu_layout_settings_tab( $settings_tab );
523 - $this->menu_styles_tab( $styles_tab );
546 + if (jltwp_adminify()->can_use_premium_code__premium_only()) {
547 + $user_info_styles_tab[] = array(
548 + 'id' => 'info_icon_color',
549 + 'type' => 'color',
550 + 'title' => __('Icon Color', WP_ADMINIFY_TD),
551 + 'default' => $this->get_default_field('menu_layout_settings')['user_info_style']['info_icon_color'],
552 + 'dependency' => array('user_info_content', '==', 'icon', 'true'),
553 + );
554 + } else {
555 + $user_info_styles_tab[] = array(
556 + 'type' => 'notice',
557 + 'title' => __('Icon Color', WP_ADMINIFY_TD),
558 + 'style' => 'warning',
559 + 'content' => Utils::adminify_upgrade_pro()
560 + );
561 + }
524 562
525 - $settings_tab = apply_filters('pxlbsadminify_settings/admin_menu/settings', $settings_tab, $this);
526 - $styles_tab = apply_filters('pxlbsadminify_settings/admin_menu/styles', $styles_tab, $this);
527 563
528 - // Menu Layout Section
529 - \ADMINIFY::createSection(
530 - $this->prefix,
531 - [
532 - 'title' => __('Admin Menu', 'adminify' ),
533 - 'icon' => 'fas fa-bars',
534 - 'fields' => [
535 - [
536 - 'type' => 'subheading',
537 - 'content' => Utils::help_urls(
538 - __('Admin Menu Settings', 'adminify' ),
539 - 'https://wpadminify.com/docs/adminify/admin-menu/admin-menu-editor',
540 - 'https://www.youtube.com/watch?v=zbEYlAg91QM',
541 - 'https://www.facebook.com/groups/jeweltheme',
542 - \PXLBSAdminify\Inc\Admin\AdminSettings::support_url()
543 - ),
544 - ],
545 - [
546 - 'id' => 'menu_layout_settings',
547 - 'type' => 'tabbed',
548 - 'title' => '',
549 - 'tabs' => [
550 - [
551 - 'title' => __( 'Menu Editor', 'adminify' ),
552 - 'fields' => [
553 - [
554 - 'id' => 'menu_editor',
555 - 'type' => 'callback',
556 - 'class' => 'adminify-one-col',
557 - 'function' => '\PXLBSAdminify\Inc\Admin\Options\MenuLayout::menu_editor_contents',
558 - ]
559 - ],
560 - ],
561 - [
562 - 'title' => __( 'Settings', 'adminify' ),
563 - 'fields' => $settings_tab,
564 - ],
565 - [
566 - 'title' => __( 'Styles', 'adminify' ),
567 - 'fields' => $styles_tab,
568 - ],
569 - ],
570 - 'default' => $this->get_defaults()['menu_layout_settings']
571 - ],
572 - ],
573 - ]
574 - );
575 - }
564 + if (jltwp_adminify()->can_use_premium_code__premium_only()) {
565 + $user_info_styles_tab[] = array(
566 + 'id' => 'info_icon_hover_color',
567 + 'type' => 'color',
568 + 'title' => __('Hover Icon Color', WP_ADMINIFY_TD),
569 + 'default' => $this->get_default_field('menu_layout_settings')['user_info_style']['info_icon_hover_color'],
570 + 'dependency' => array('user_info_content', '==', 'icon', 'true'),
571 + );
572 + } else {
573 + $user_info_styles_tab[] = array(
574 + 'type' => 'notice',
575 + 'title' => __('Hover Icon Color', WP_ADMINIFY_TD),
576 + 'style' => 'warning',
577 + 'content' => Utils::adminify_upgrade_pro()
578 + );
579 + }
580 + }
581 +
582 +
583 + public function menu_styles_tab(&$styles_tab)
584 + {
585 + $menu_styles_tab = [];
586 + $user_info_styles_tab = [];
587 + $this->menu_layout_style_tab($menu_styles_tab);
588 + $this->user_info_style_tab($user_info_styles_tab);
589 +
590 + $styles_tab[] = array(
591 + 'id' => 'menu_styles',
592 + 'type' => 'fieldset',
593 + 'title' => '',
594 + 'fields' => $menu_styles_tab,
595 + );
596 +
597 + if (jltwp_adminify()->can_use_premium_code__premium_only()) {
598 + $styles_tab[] = array(
599 + 'id' => 'user_info_style',
600 + 'type' => 'fieldset',
601 + 'title' => '',
602 + 'fields' => $user_info_styles_tab,
603 + 'dependency' => array('layout_type|user_info', '==|==', 'vertical|true', 'true'),
604 + );
605 + } else {
606 + $styles_tab[] = array(
607 + 'id' => 'user_info_style',
608 + 'type' => 'fieldset',
609 + 'title' => '',
610 + 'fields' => $user_info_styles_tab,
611 + 'dependency' => array('layout_type', '==', 'vertical', 'true'),
612 + );
613 + }
614 + }
615 +
616 +
617 + public function menu_layout_settings()
618 + {
619 +
620 + if (!class_exists('ADMINIFY')) {
621 + return;
622 + }
623 +
624 + $settings_tab = [];
625 + $styles_tab = [];
626 +
627 + $this->menu_layout_settings_tab($settings_tab);
628 + $this->menu_styles_tab($styles_tab);
629 +
630 + // Menu Layout Section
631 + \ADMINIFY::createSection($this->prefix, array(
632 + 'title' => __('Menu Settings', WP_ADMINIFY_TD),
633 + 'icon' => 'fas fa-bars',
634 + 'fields' => array(
635 + array(
636 + 'type' => 'subheading',
637 + 'content' => Utils::adminfiy_help_urls(
638 + __('Menu Settings', WP_ADMINIFY_TD),
639 + 'https://wpadminify.com/kb/dashboard-menu-settings/',
640 + 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
641 + 'https://www.facebook.com/groups/jeweltheme',
642 + 'https://wpadminify.com/support/'
643 + )
644 + ),
645 + array(
646 + 'id' => 'menu_layout_settings',
647 + 'type' => 'tabbed',
648 + 'title' => '',
649 + 'tabs' => array(
650 + array(
651 + 'title' => 'Settings',
652 + 'fields' => $settings_tab,
653 + ),
654 + array(
655 + 'title' => 'Styles',
656 + 'fields' => $styles_tab,
657 + )
658 + ),
659 + ),
660 + )
661 + ));
662 + }
576 663 }