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