breadcrumbs.php
6 months ago
copyright.php
6 months ago
current-time.php
6 months ago
logo.php
6 months ago
menu.php
6 months ago
modern-search.php
6 months ago
search.php
6 months ago
select.php
6 months ago
shopping-cart.php
6 months ago
site-title.php
6 months ago
menu.php
1643 lines
| 1 | <?php |
| 2 | namespace Auxin\Plugin\CoreElements\Elementor\Elements\Theme_Elements; |
| 3 | |
| 4 | use Elementor\Plugin; |
| 5 | use Elementor\Widget_Base; |
| 6 | use Elementor\Controls_Manager; |
| 7 | use Elementor\Group_Control_Typography; |
| 8 | use Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 9 | use Elementor\Group_Control_Border; |
| 10 | use Elementor\Group_Control_Background; |
| 11 | use Elementor\Group_Control_Box_Shadow; |
| 12 | use Elementor\Group_Control_Text_Shadow; |
| 13 | |
| 14 | |
| 15 | if ( ! defined( 'ABSPATH' ) ) { |
| 16 | exit; // Exit if accessed directly. |
| 17 | } |
| 18 | |
| 19 | /** |
| 20 | * Elementor 'MenuBox' widget. |
| 21 | * |
| 22 | * Elementor widget that displays an 'MenuBox'. |
| 23 | * |
| 24 | * @since 1.0.0 |
| 25 | */ |
| 26 | class MenuBox extends Widget_Base { |
| 27 | |
| 28 | /** |
| 29 | * Get widget name. |
| 30 | * |
| 31 | * Retrieve 'MenuBox' widget name. |
| 32 | * |
| 33 | * @since 1.0.0 |
| 34 | * @access public |
| 35 | * |
| 36 | * @return string Widget name. |
| 37 | */ |
| 38 | public function get_name() { |
| 39 | return 'aux_menu_box'; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Get widget title. |
| 44 | * |
| 45 | * Retrieve 'MenuBox' widget title. |
| 46 | * |
| 47 | * @since 1.0.0 |
| 48 | * @access public |
| 49 | * |
| 50 | * @return string Widget title. |
| 51 | */ |
| 52 | public function get_title() { |
| 53 | return __('Navigation Menu', 'auxin-elements' ); |
| 54 | } |
| 55 | |
| 56 | public function has_widget_inner_wrapper(): bool { |
| 57 | return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); |
| 58 | } |
| 59 | |
| 60 | |
| 61 | /** |
| 62 | * Get widget icon. |
| 63 | * |
| 64 | * Retrieve 'MenuBox' widget icon. |
| 65 | * |
| 66 | * @since 1.0.0 |
| 67 | * @access public |
| 68 | * |
| 69 | * @return string Widget icon. |
| 70 | */ |
| 71 | public function get_icon() { |
| 72 | return 'eicon-nav-menu auxin-badge'; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Get widget categories. |
| 77 | * |
| 78 | * Retrieve 'MenuBox' widget icon. |
| 79 | * |
| 80 | * @since 1.0.0 |
| 81 | * @access public |
| 82 | * |
| 83 | * @return string Widget icon. |
| 84 | */ |
| 85 | public function get_categories() { |
| 86 | return array( 'auxin-core', 'auxin-theme-elements' ); |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Get the all available menus |
| 91 | * |
| 92 | * Retrieve the list of all menus. |
| 93 | * |
| 94 | * @since 1.0.0 |
| 95 | * @access public |
| 96 | * |
| 97 | * @return array menu slug. |
| 98 | */ |
| 99 | private function get_available_menus() { |
| 100 | $menus = wp_get_nav_menus(); |
| 101 | |
| 102 | $options = array(); |
| 103 | |
| 104 | foreach ( $menus as $menu ) { |
| 105 | $options[ $menu->slug ] = $menu->name; |
| 106 | } |
| 107 | |
| 108 | return $options; |
| 109 | } |
| 110 | |
| 111 | |
| 112 | /** |
| 113 | * Register 'MenuBox' widget controls. |
| 114 | * |
| 115 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 116 | * |
| 117 | * @since 1.0.0 |
| 118 | * @access protected |
| 119 | */ |
| 120 | protected function register_controls() { |
| 121 | |
| 122 | $this->start_controls_section( |
| 123 | 'general', |
| 124 | array( |
| 125 | 'label' => __('General', 'auxin-elements' ), |
| 126 | ) |
| 127 | ); |
| 128 | |
| 129 | $menus = $this->get_available_menus(); |
| 130 | |
| 131 | if ( ! empty( $menus ) ) { |
| 132 | $this->add_control( |
| 133 | 'menu_slug', |
| 134 | array( |
| 135 | 'label' => __( 'Menu', 'auxin-elements' ), |
| 136 | 'type' => Controls_Manager::SELECT, |
| 137 | 'options' => $menus, |
| 138 | 'default' => array_keys( $menus )[0], |
| 139 | 'save_default' => true, |
| 140 | 'description' => sprintf( |
| 141 | __( 'Go to the %s Menus screen %s to manage your menus.', 'auxin-elements' ), |
| 142 | '<a href="'. self_admin_url( 'nav-menus.php' ) .'" target="_blank">', |
| 143 | '</a>' |
| 144 | ) |
| 145 | ) |
| 146 | ); |
| 147 | } else { |
| 148 | $this->add_control( |
| 149 | 'menu_slug', |
| 150 | array( |
| 151 | 'type' => Controls_Manager::RAW_HTML, |
| 152 | 'raw' => sprintf( __( '<strong>There are no menus in your site.</strong><br>Go to the <a href="%s" target="_blank">Menus screen</a> to create one.', 'auxin-elements' ), self_admin_url( 'nav-menus.php?action=edit&menu=0' ) ), |
| 153 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 154 | ) |
| 155 | ); |
| 156 | } |
| 157 | |
| 158 | $this->add_control( |
| 159 | 'type', |
| 160 | array( |
| 161 | 'label' => __('Type', 'auxin-elements'), |
| 162 | 'type' => Controls_Manager::SELECT, |
| 163 | 'default' => 'horizontal', |
| 164 | 'options' => array( |
| 165 | 'horizontal' => __('Horizontal' , 'auxin-elements' ), |
| 166 | 'vertical' => __('Vertical' , 'auxin-elements' ), |
| 167 | 'burger' => __('Burger' , 'auxin-elements' ) |
| 168 | ), |
| 169 | 'condition' => array( |
| 170 | 'menu_slug!' => '' |
| 171 | ) |
| 172 | ) |
| 173 | ); |
| 174 | |
| 175 | $this->add_control( |
| 176 | 'splitter', |
| 177 | array( |
| 178 | 'label' => __( 'Display Menu Splitter', 'auxin-elements' ), |
| 179 | 'type' => Controls_Manager::SWITCHER, |
| 180 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 181 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 182 | 'return_value' => 'yes', |
| 183 | 'default' => 'yes', |
| 184 | 'condition' => array( |
| 185 | 'type' => 'horizontal' |
| 186 | ) |
| 187 | ) |
| 188 | ); |
| 189 | |
| 190 | $this->add_control( |
| 191 | 'indicator', |
| 192 | array( |
| 193 | 'label' => __( 'Display Submenu Indicator', 'auxin-elements' ), |
| 194 | 'type' => Controls_Manager::SWITCHER, |
| 195 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 196 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 197 | 'return_value' => 'yes', |
| 198 | 'default' => 'yes', |
| 199 | ) |
| 200 | ); |
| 201 | |
| 202 | $this->end_controls_section(); |
| 203 | |
| 204 | $this->start_controls_section( |
| 205 | 'mobile_menu_section', |
| 206 | array( |
| 207 | 'label' => __('Mobile Menu', 'auxin-elements' ), |
| 208 | ) |
| 209 | ); |
| 210 | |
| 211 | $this->add_control( |
| 212 | 'display_burger', |
| 213 | array( |
| 214 | 'label' => __('Display Mobile Menu on', 'auxin-elements'), |
| 215 | 'label_block' => true, |
| 216 | 'type' => Controls_Manager::SELECT, |
| 217 | 'default' => '768', |
| 218 | 'options' => array( |
| 219 | '1024' => __('Tablet (1024px and lower)' , 'auxin-elements' ), |
| 220 | '768' => __('Mobile (768px and lower)' , 'auxin-elements' ), |
| 221 | 'custom' => __('Custom Breakpoint', 'auxin-elements' ) |
| 222 | ), |
| 223 | 'condition' => array( |
| 224 | 'menu_slug!' => '' |
| 225 | ) |
| 226 | ) |
| 227 | ); |
| 228 | |
| 229 | $this->add_control( |
| 230 | 'breakpoint', |
| 231 | array( |
| 232 | 'label' => __('BreakPoint (pixel)', 'auxin-elements' ), |
| 233 | 'type' => Controls_Manager::SLIDER, |
| 234 | 'size_units' => array('px'), |
| 235 | 'range' => array( |
| 236 | 'px' => array( |
| 237 | 'min' => 1, |
| 238 | 'max' => 1600, |
| 239 | 'step' => 1 |
| 240 | ) |
| 241 | ), |
| 242 | 'default' => array( |
| 243 | 'unit' => 'px', |
| 244 | 'size' => 768 |
| 245 | ), |
| 246 | 'separator' => 'before', |
| 247 | 'condition' => array( |
| 248 | 'type!' => 'burger', |
| 249 | 'display_burger' => 'custom' |
| 250 | ) |
| 251 | ) |
| 252 | ); |
| 253 | |
| 254 | $this->add_control( |
| 255 | 'burger_menu_location', |
| 256 | array( |
| 257 | 'label' => __('Mobile Menu Type', 'auxin-elements' ), |
| 258 | 'type' => 'aux-visual-select', |
| 259 | 'style_items' => '', |
| 260 | 'options' => array( |
| 261 | 'toggle-bar' => array( |
| 262 | 'label' => __( 'Expandable under top header', 'auxin-elements' ), |
| 263 | 'image' => AUXIN_URL . 'images/visual-select/burger-menu-location-1.svg' |
| 264 | ), |
| 265 | 'overlay' => array( |
| 266 | 'label' => __( 'FullScreen on entire page', 'auxin-elements' ), |
| 267 | 'image' => AUXIN_URL . 'images/visual-select/burger-menu-location-3.svg' |
| 268 | ), |
| 269 | 'offcanvas' => array( |
| 270 | 'label' => __( 'Offcanvas panel', 'auxin-elements' ), |
| 271 | 'image' => AUXIN_URL . 'images/visual-select/burger-menu-location-2.svg' |
| 272 | ) |
| 273 | ), |
| 274 | 'default' => 'toggle-bar', |
| 275 | 'seperator' => 'before' |
| 276 | ) |
| 277 | ); |
| 278 | |
| 279 | $this->add_control( |
| 280 | 'offcanvas_align', |
| 281 | array( |
| 282 | 'label' => __( 'Position', 'auxin-elements' ), |
| 283 | 'type' => Controls_Manager::SELECT, |
| 284 | 'default' => 'left', |
| 285 | 'options' => array( |
| 286 | 'left' => __('Left' , 'auxin-elements' ), |
| 287 | 'right' => __('Right' , 'auxin-elements' ) |
| 288 | ), |
| 289 | 'condition' => array( |
| 290 | 'burger_menu_location' => 'offcanvas' |
| 291 | ) |
| 292 | ) |
| 293 | ); |
| 294 | |
| 295 | $this->add_control( |
| 296 | 'burger_toggle_type', |
| 297 | array( |
| 298 | 'label' => __('Mobile Menu Opening Type', 'auxin-elements'), |
| 299 | 'label_block' => true, |
| 300 | 'type' => Controls_Manager::SELECT, |
| 301 | 'default' => 'toggle', |
| 302 | 'options' => array( |
| 303 | 'toggle' => __('Toggle' , 'auxin-elements' ), |
| 304 | 'accordion' => __('Accordion' , 'auxin-elements' ) |
| 305 | ) |
| 306 | ) |
| 307 | ); |
| 308 | |
| 309 | $this->end_controls_section(); |
| 310 | |
| 311 | /*-----------------------------------------------------------------------------------*/ |
| 312 | /* Style TAB |
| 313 | /*-----------------------------------------------------------------------------------*/ |
| 314 | |
| 315 | /* Menu Item Section |
| 316 | /*-------------------------------------*/ |
| 317 | |
| 318 | $this->start_controls_section( |
| 319 | 'menu_item_section', |
| 320 | array( |
| 321 | 'label' => __( 'Menu Item', 'auxin-elements' ), |
| 322 | 'tab' => Controls_Manager::TAB_STYLE |
| 323 | ) |
| 324 | ); |
| 325 | |
| 326 | $this->add_responsive_control( |
| 327 | 'align', |
| 328 | array( |
| 329 | 'label' => __('Text Align', 'auxin-elements'), |
| 330 | 'type' => Controls_Manager::CHOOSE, |
| 331 | 'options' => array( |
| 332 | 'left' => array( |
| 333 | 'title' => __( 'Left', 'auxin-elements' ), |
| 334 | 'icon' => 'eicon-text-align-left' |
| 335 | ), |
| 336 | 'center' => array( |
| 337 | 'title' => __( 'Center', 'auxin-elements' ), |
| 338 | 'icon' => 'eicon-text-align-center' |
| 339 | ), |
| 340 | 'right' => array( |
| 341 | 'title' => __( 'Right', 'auxin-elements' ), |
| 342 | 'icon' => 'eicon-text-align-right' |
| 343 | ) |
| 344 | ), |
| 345 | 'default' => 'left', |
| 346 | 'toggle' => true, |
| 347 | 'selectors_dictionary' => [ |
| 348 | 'left' => 'text-align:left;', |
| 349 | 'center' => 'display: block; text-align:center;', |
| 350 | 'right' => 'display:block; text-align:right;' |
| 351 | ], |
| 352 | 'selectors' => array( |
| 353 | '{{WRAPPER}}' => '{{VALUE}};', |
| 354 | '{{WRAPPER}} .aux-vertical .aux-menu-depth-0 .aux-item-content' => '{{VALUE}}' |
| 355 | ) |
| 356 | ) |
| 357 | ); |
| 358 | |
| 359 | $this->start_controls_tabs( 'item_colors' ); |
| 360 | |
| 361 | $this->start_controls_tab( |
| 362 | 'item_color_normal', |
| 363 | array( |
| 364 | 'label' => __( 'Normal' , 'auxin-elements' ) |
| 365 | ) |
| 366 | ); |
| 367 | |
| 368 | $this->add_control( |
| 369 | 'item_color', |
| 370 | array( |
| 371 | 'label' => __( 'Color', 'auxin-elements' ), |
| 372 | 'type' => Controls_Manager::COLOR, |
| 373 | 'selectors' => array( |
| 374 | '{{WRAPPER}} .aux-menu-depth-0 > .aux-item-content' => 'color: {{VALUE}};' |
| 375 | ) |
| 376 | ) |
| 377 | ); |
| 378 | |
| 379 | $this->add_group_control( |
| 380 | Group_Control_Typography::get_type(), |
| 381 | array( |
| 382 | 'name' => 'menu_item_typo', |
| 383 | 'global' => [ |
| 384 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 385 | ], |
| 386 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0 > .aux-item-content' |
| 387 | ) |
| 388 | ); |
| 389 | |
| 390 | $this->add_group_control( |
| 391 | Group_Control_Text_Shadow::get_type(), |
| 392 | [ |
| 393 | 'name' => 'menu_item_text_shadow', |
| 394 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0 > .aux-item-content' |
| 395 | ] |
| 396 | ); |
| 397 | |
| 398 | $this->add_group_control( |
| 399 | Group_Control_Box_Shadow::get_type(), |
| 400 | array( |
| 401 | 'name' => 'item_box_shadow', |
| 402 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0' |
| 403 | ) |
| 404 | ); |
| 405 | |
| 406 | $this->add_group_control( |
| 407 | Group_Control_Background::get_type(), |
| 408 | array( |
| 409 | 'name' => 'item_background', |
| 410 | 'label' => __( 'Background', 'auxin-elements' ), |
| 411 | 'types' => array( 'classic', 'gradient' ), |
| 412 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0 ' |
| 413 | ) |
| 414 | ); |
| 415 | |
| 416 | $this->add_group_control( |
| 417 | Group_Control_Border::get_type(), |
| 418 | array( |
| 419 | 'name' => 'item_border', |
| 420 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0', |
| 421 | 'separator' => 'none' |
| 422 | ) |
| 423 | ); |
| 424 | |
| 425 | $this->add_responsive_control( |
| 426 | 'item_border_radius', |
| 427 | array( |
| 428 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 429 | 'type' => Controls_Manager::DIMENSIONS, |
| 430 | 'size_units' => array( 'px', 'em', '%' ), |
| 431 | 'selectors' => array( |
| 432 | '{{WRAPPER}} .aux-menu-depth-0' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 433 | ), |
| 434 | 'allowed_dimensions' => 'all' |
| 435 | ) |
| 436 | ); |
| 437 | |
| 438 | $this->end_controls_tab(); |
| 439 | |
| 440 | $this->start_controls_tab( |
| 441 | 'item_color_hover', |
| 442 | array( |
| 443 | 'label' => __( 'Hover' , 'auxin-elements' ) |
| 444 | ) |
| 445 | ); |
| 446 | |
| 447 | $this->add_control( |
| 448 | 'item_hover_color', |
| 449 | array( |
| 450 | 'label' => __( 'Color', 'auxin-elements' ), |
| 451 | 'type' => Controls_Manager::COLOR, |
| 452 | 'selectors' => array( |
| 453 | '{{WRAPPER}} .aux-menu-depth-0.aux-hover > .aux-item-content ' => 'color: {{VALUE}} !important;' |
| 454 | ) |
| 455 | ) |
| 456 | ); |
| 457 | |
| 458 | $this->add_group_control( |
| 459 | Group_Control_Typography::get_type(), |
| 460 | array( |
| 461 | 'name' => 'menu_item_typo_hover', |
| 462 | 'global' => [ |
| 463 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 464 | ], |
| 465 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0.aux-hover > .aux-item-content', |
| 466 | ) |
| 467 | ); |
| 468 | |
| 469 | $this->add_group_control( |
| 470 | Group_Control_Text_Shadow::get_type(), |
| 471 | [ |
| 472 | 'name' => 'menu_item_text_shadow_hover', |
| 473 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0.aux-hover > .aux-item-content' |
| 474 | ] |
| 475 | ); |
| 476 | |
| 477 | $this->add_group_control( |
| 478 | Group_Control_Box_Shadow::get_type(), |
| 479 | array( |
| 480 | 'name' => 'hover_item_box_shadow', |
| 481 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0.aux-hover' |
| 482 | ) |
| 483 | ); |
| 484 | |
| 485 | $this->add_group_control( |
| 486 | Group_Control_Background::get_type(), |
| 487 | array( |
| 488 | 'name' => 'hover_item_background', |
| 489 | 'label' => __( 'Background', 'auxin-elements' ), |
| 490 | 'types' => array( 'classic', 'gradient' ), |
| 491 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0.aux-hover' |
| 492 | ) |
| 493 | ); |
| 494 | |
| 495 | $this->add_group_control( |
| 496 | Group_Control_Border::get_type(), |
| 497 | array( |
| 498 | 'name' => 'item_hover_border', |
| 499 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0.aux-hover', |
| 500 | 'separator' => 'none' |
| 501 | ) |
| 502 | ); |
| 503 | |
| 504 | $this->add_responsive_control( |
| 505 | 'item_hover_border_radius', |
| 506 | array( |
| 507 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 508 | 'type' => Controls_Manager::DIMENSIONS, |
| 509 | 'size_units' => array( 'px', 'em', '%' ), |
| 510 | 'selectors' => array( |
| 511 | '{{WRAPPER}} .aux-menu-depth-0.aux-hover' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 512 | ), |
| 513 | 'allowed_dimensions' => 'all', |
| 514 | ) |
| 515 | ); |
| 516 | |
| 517 | |
| 518 | $this->end_controls_tab(); |
| 519 | |
| 520 | $this->end_controls_tabs(); |
| 521 | |
| 522 | |
| 523 | $this->add_responsive_control( |
| 524 | 'item_padding', |
| 525 | array( |
| 526 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 527 | 'type' => Controls_Manager::DIMENSIONS, |
| 528 | 'size_units' => array( 'px', '%' ), |
| 529 | 'selectors' => array( |
| 530 | '{{WRAPPER}} .aux-menu-depth-0 > .aux-item-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 531 | ), |
| 532 | 'separator' => 'before' |
| 533 | ) |
| 534 | ); |
| 535 | |
| 536 | $this->add_responsive_control( |
| 537 | 'item_margin', |
| 538 | array( |
| 539 | 'label' => __( 'Margin', 'auxin-elements' ), |
| 540 | 'type' => Controls_Manager::DIMENSIONS, |
| 541 | 'size_units' => array( 'px', '%' ), |
| 542 | 'selectors' => array( |
| 543 | '{{WRAPPER}} .aux-menu-depth-0' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 544 | ), |
| 545 | 'seperator' => 'after' |
| 546 | ) |
| 547 | ); |
| 548 | |
| 549 | $this->end_controls_section(); |
| 550 | |
| 551 | /* Menu item - Current Section |
| 552 | /*-------------------------------------*/ |
| 553 | |
| 554 | $this->start_controls_section( |
| 555 | 'menu_item_current_section', |
| 556 | array( |
| 557 | 'label' => __( 'Menu Item - Selected', 'auxin-elements' ), |
| 558 | 'tab' => Controls_Manager::TAB_STYLE |
| 559 | ) |
| 560 | ); |
| 561 | |
| 562 | $this->add_control( |
| 563 | 'menu_item_current_color', |
| 564 | array( |
| 565 | 'label' => __( 'Color', 'auxin-elements' ), |
| 566 | 'type' => Controls_Manager::COLOR, |
| 567 | 'selectors' => array( |
| 568 | '{{WRAPPER}} .aux-menu-depth-0.current-menu-item > a' => 'color: {{VALUE}};', |
| 569 | ), |
| 570 | ) |
| 571 | ); |
| 572 | |
| 573 | $this->add_group_control( |
| 574 | Group_Control_Typography::get_type(), |
| 575 | array( |
| 576 | 'name' => 'menu_item_current_typography', |
| 577 | 'global' => [ |
| 578 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 579 | ], |
| 580 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0.current-menu-item > a' |
| 581 | ) |
| 582 | ); |
| 583 | |
| 584 | $this->add_group_control( |
| 585 | Group_Control_Text_Shadow::get_type(), |
| 586 | [ |
| 587 | 'name' => 'menu_item_current_text_shadow', |
| 588 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0.current-menu-item > a' |
| 589 | ] |
| 590 | ); |
| 591 | |
| 592 | $this->add_group_control( |
| 593 | Group_Control_Box_Shadow::get_type(), |
| 594 | array( |
| 595 | 'name' => 'menu_item_current_box_shadow', |
| 596 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0.current-menu-item > a' |
| 597 | ) |
| 598 | ); |
| 599 | |
| 600 | $this->add_group_control( |
| 601 | Group_Control_Background::get_type(), |
| 602 | array( |
| 603 | 'name' => 'menu_item_current_background', |
| 604 | 'label' => __( 'Background', 'auxin-elements' ), |
| 605 | 'types' => array( 'classic', 'gradient' ), |
| 606 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0.current-menu-item > a ' |
| 607 | ) |
| 608 | ); |
| 609 | |
| 610 | $this->end_controls_section(); |
| 611 | |
| 612 | |
| 613 | /* Submenu Section |
| 614 | /*-------------------------------------*/ |
| 615 | |
| 616 | $this->start_controls_section( |
| 617 | 'submenu_style_section', |
| 618 | array( |
| 619 | 'label' => __( 'Submenu', 'auxin-elements' ), |
| 620 | 'tab' => Controls_Manager::TAB_STYLE |
| 621 | ) |
| 622 | ); |
| 623 | |
| 624 | $this->add_control( |
| 625 | 'submenu_skin', |
| 626 | array( |
| 627 | 'label' => __('Skin','auxin-elements' ), |
| 628 | 'type' => 'aux-visual-select', |
| 629 | 'style_items' => 'max-width:45%;', |
| 630 | 'options' => array( |
| 631 | 'classic' => array( |
| 632 | 'label' => __('Paradox', 'auxin-elements' ), |
| 633 | 'image' => AUXIN_URL . 'images/visual-select/sub-menu-skin-1.svg' |
| 634 | ), |
| 635 | 'classic-center' => array( |
| 636 | 'label' => __( 'Classic', 'auxin-elements' ), |
| 637 | 'image' => AUXIN_URL . 'images/visual-select/sub-menu-skin-2.svg' |
| 638 | ), |
| 639 | 'dash-divided' => array( |
| 640 | 'label' => __( 'Dark Transparent', 'auxin-elements' ), |
| 641 | 'image' => AUXIN_URL . 'images/visual-select/sub-menu-skin-5.svg' |
| 642 | ), |
| 643 | 'divided' => array( |
| 644 | 'label' => __( 'Divided', 'auxin-elements' ), |
| 645 | 'image' => AUXIN_URL . 'images/visual-select/sub-menu-skin-3.svg' |
| 646 | ), |
| 647 | 'minimal-center' => array( |
| 648 | 'label' => __( 'Center Paradox', 'auxin-elements' ), |
| 649 | 'image' => AUXIN_URL . 'images/visual-select/sub-menu-skin-4.svg' |
| 650 | ), |
| 651 | 'modern' => array( |
| 652 | 'label' => __( 'Modern Paradox', 'auxin-elements' ), |
| 653 | 'image' => AUXIN_URL . 'images/visual-select/sub-menu-skin-6.svg' |
| 654 | ) |
| 655 | ), |
| 656 | 'default' => 'classic', |
| 657 | 'separator' => 'after' |
| 658 | ) |
| 659 | ); |
| 660 | |
| 661 | $this->add_control( |
| 662 | 'submenu_anim', |
| 663 | array( |
| 664 | 'label' => __('Animation Effect','auxin-elements' ), |
| 665 | 'type' => 'aux-visual-select', |
| 666 | 'style_items' => 'max-width:100%;', |
| 667 | 'options' => array( |
| 668 | 'none' => array( |
| 669 | 'label' => __( 'None', 'auxin-elements' ), |
| 670 | 'video_src' => AUXIN_URL . 'images/visual-select/videos/NoFade.webm webm' |
| 671 | ), |
| 672 | 'fade' => array( |
| 673 | 'label' => __( 'Fade', 'auxin-elements' ), |
| 674 | 'video_src' => AUXIN_URL . 'images/visual-select/videos/Fade.webm webm' |
| 675 | ), |
| 676 | 'slide-up' => array( |
| 677 | 'label' => __( 'Fade and move', 'auxin-elements' ), |
| 678 | 'video_src' => AUXIN_URL . 'images/visual-select/videos/FadeAndMove.webm webm' |
| 679 | ) |
| 680 | ), |
| 681 | 'default' => 'none', |
| 682 | 'seperator' => 'after' |
| 683 | ) |
| 684 | ); |
| 685 | |
| 686 | $this->start_controls_tabs( 'sub_background_tab' ); |
| 687 | |
| 688 | $this->start_controls_tab( |
| 689 | 'submenu_style_normal', |
| 690 | array( |
| 691 | 'label' => __( 'Normal' , 'auxin-elements' ) |
| 692 | ) |
| 693 | ); |
| 694 | |
| 695 | $this->add_group_control( |
| 696 | Group_Control_Background::get_type(), |
| 697 | array( |
| 698 | 'name' => 'sub_background', |
| 699 | 'label' => __( 'Background', 'auxin-elements' ), |
| 700 | 'types' => array( 'classic', 'gradient' ), |
| 701 | 'selector' => '{{WRAPPER}} .aux-menu-item.aux-open > .aux-submenu' |
| 702 | ) |
| 703 | ); |
| 704 | |
| 705 | $this->add_group_control( |
| 706 | Group_Control_Box_Shadow::get_type(), |
| 707 | array( |
| 708 | 'name' => 'sub_box_shadow', |
| 709 | 'selector' => '{{WRAPPER}} .aux-menu-item.aux-open > .aux-submenu' |
| 710 | ) |
| 711 | ); |
| 712 | |
| 713 | $this->add_responsive_control( |
| 714 | 'sub_border_radius', |
| 715 | array( |
| 716 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 717 | 'type' => Controls_Manager::DIMENSIONS, |
| 718 | 'size_units' => array( 'px', 'em', '%' ), |
| 719 | 'selectors' => array( |
| 720 | '{{WRAPPER}} .aux-menu-item.aux-open > .aux-submenu' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 721 | ), |
| 722 | 'allowed_dimensions' => 'all', |
| 723 | ) |
| 724 | ); |
| 725 | |
| 726 | $this->add_group_control( |
| 727 | Group_Control_Border::get_type(), |
| 728 | array( |
| 729 | 'name' => 'sub_border', |
| 730 | 'selector' => '{{WRAPPER}} .aux-menu-item.aux-open > .aux-submenu', |
| 731 | 'separator' => 'none' |
| 732 | ) |
| 733 | ); |
| 734 | |
| 735 | $this->end_controls_tab(); |
| 736 | |
| 737 | $this->start_controls_tab( |
| 738 | 'submenu_style_hover', |
| 739 | array( |
| 740 | 'label' => __( 'Hover' , 'auxin-elements' ) |
| 741 | ) |
| 742 | ); |
| 743 | |
| 744 | $this->add_group_control( |
| 745 | Group_Control_Background::get_type(), |
| 746 | array( |
| 747 | 'name' => 'hover_sub_background', |
| 748 | 'label' => __( 'Background', 'auxin-elements' ), |
| 749 | 'types' => array( 'classic', 'gradient' ), |
| 750 | 'selector' => '{{WRAPPER}} .aux-menu-item.aux-open > .aux-submenu:hover' |
| 751 | ) |
| 752 | ); |
| 753 | |
| 754 | $this->add_group_control( |
| 755 | Group_Control_Box_Shadow::get_type(), |
| 756 | array( |
| 757 | 'name' => 'hover_sub_box_shadow', |
| 758 | 'selector' => '{{WRAPPER}} .aux-menu-item.aux-open > .aux-submenu:hover' |
| 759 | ) |
| 760 | ); |
| 761 | |
| 762 | $this->add_responsive_control( |
| 763 | 'sub_hover_border_radius', |
| 764 | array( |
| 765 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 766 | 'type' => Controls_Manager::DIMENSIONS, |
| 767 | 'size_units' => array( 'px', 'em', '%' ), |
| 768 | 'selectors' => array( |
| 769 | '{{WRAPPER}} .aux-menu-item.aux-open > .aux-submenu:hover' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 770 | ), |
| 771 | 'allowed_dimensions' => 'all', |
| 772 | ) |
| 773 | ); |
| 774 | |
| 775 | $this->add_group_control( |
| 776 | Group_Control_Border::get_type(), |
| 777 | array( |
| 778 | 'name' => 'sub_hover_border', |
| 779 | 'selector' => '{{WRAPPER}} .aux-menu-item.aux-open > .aux-submenu:hover', |
| 780 | 'separator' => 'none' |
| 781 | ) |
| 782 | ); |
| 783 | |
| 784 | $this->end_controls_tab(); |
| 785 | |
| 786 | $this->end_controls_tabs(); |
| 787 | |
| 788 | $this->end_controls_section(); |
| 789 | |
| 790 | |
| 791 | /* SubMenu Item Section |
| 792 | /*-------------------------------------*/ |
| 793 | |
| 794 | $this->start_controls_section( |
| 795 | 'submenu_item_section', |
| 796 | array( |
| 797 | 'label' => __( 'Submenu Item', 'auxin-elements' ), |
| 798 | 'tab' => Controls_Manager::TAB_STYLE |
| 799 | ) |
| 800 | ); |
| 801 | |
| 802 | $this->start_controls_tabs( 'sub_item_colors' ); |
| 803 | |
| 804 | $this->start_controls_tab( |
| 805 | 'sub_item_color_normal', |
| 806 | array( |
| 807 | 'label' => __( 'Normal' , 'auxin-elements' ) |
| 808 | ) |
| 809 | ); |
| 810 | |
| 811 | $this->add_control( |
| 812 | 'sub_item_color', |
| 813 | array( |
| 814 | 'label' => __( 'Color', 'auxin-elements' ), |
| 815 | 'type' => Controls_Manager::COLOR, |
| 816 | 'selectors' => array( |
| 817 | '{{WRAPPER}} .aux-submenu .aux-menu-item .aux-item-content' => 'color: {{VALUE}} !important;', |
| 818 | ), |
| 819 | 'seperartor' => 'after' |
| 820 | ) |
| 821 | ); |
| 822 | |
| 823 | $this->add_group_control( |
| 824 | Group_Control_Typography::get_type(), |
| 825 | array( |
| 826 | 'name' => 'menu_sub_item_typo', |
| 827 | 'global' => [ |
| 828 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 829 | ], |
| 830 | 'selector' => '{{WRAPPER}} .aux-submenu .aux-menu-item', |
| 831 | ) |
| 832 | ); |
| 833 | |
| 834 | $this->add_group_control( |
| 835 | Group_Control_Text_Shadow::get_type(), |
| 836 | [ |
| 837 | 'name' => 'sub_item_text_shadow', |
| 838 | 'selector' => '{{WRAPPER}} .aux-submenu .aux-menu-item .aux-item-content' |
| 839 | ] |
| 840 | ); |
| 841 | |
| 842 | $this->add_group_control( |
| 843 | Group_Control_Box_Shadow::get_type(), |
| 844 | array( |
| 845 | 'name' => 'sub_item_box_shadow', |
| 846 | 'selector' => '{{WRAPPER}} .aux-submenu .aux-menu-item .aux-item-content' |
| 847 | ) |
| 848 | ); |
| 849 | |
| 850 | $this->add_group_control( |
| 851 | Group_Control_Background::get_type(), |
| 852 | array( |
| 853 | 'name' => 'sub_item_background', |
| 854 | 'label' => __( 'Background', 'auxin-elements' ), |
| 855 | 'types' => array( 'classic', 'gradient' ), |
| 856 | 'selector' => '{{WRAPPER}} .aux-submenu .aux-menu-item .aux-item-content' |
| 857 | ) |
| 858 | ); |
| 859 | |
| 860 | |
| 861 | $this->add_responsive_control( |
| 862 | 'sub_item_border_radius', |
| 863 | array( |
| 864 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 865 | 'type' => Controls_Manager::DIMENSIONS, |
| 866 | 'size_units' => array( 'px', 'em', '%' ), |
| 867 | 'selectors' => array( |
| 868 | '{{WRAPPER}} .aux-submenu .aux-menu-item .aux-item-content' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 869 | ), |
| 870 | 'allowed_dimensions' => 'all', |
| 871 | ) |
| 872 | ); |
| 873 | |
| 874 | $this->add_group_control( |
| 875 | Group_Control_Border::get_type(), |
| 876 | array( |
| 877 | 'name' => 'sub_item_border', |
| 878 | 'selector' => '{{WRAPPER}} .aux-submenu .aux-menu-item .aux-item-content', |
| 879 | 'separator' => 'none' |
| 880 | ) |
| 881 | ); |
| 882 | |
| 883 | $this->end_controls_tab(); |
| 884 | |
| 885 | $this->start_controls_tab( |
| 886 | 'sub_item_color_hover', |
| 887 | array( |
| 888 | 'label' => __( 'Hover' , 'auxin-elements' ) |
| 889 | ) |
| 890 | ); |
| 891 | |
| 892 | $this->add_control( |
| 893 | 'sub_item_hover_color', |
| 894 | array( |
| 895 | 'label' => __( 'Color', 'auxin-elements' ), |
| 896 | 'type' => Controls_Manager::COLOR, |
| 897 | 'selectors' => array( |
| 898 | '{{WRAPPER}} .aux-submenu .aux-menu-item.aux-hover .aux-item-content' => 'color: {{VALUE}} !important;' |
| 899 | ), |
| 900 | 'seperartor' => 'after' |
| 901 | ) |
| 902 | ); |
| 903 | |
| 904 | $this->add_group_control( |
| 905 | Group_Control_Typography::get_type(), |
| 906 | array( |
| 907 | 'name' => 'menu_sub_item_typo_hover', |
| 908 | 'global' => [ |
| 909 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 910 | ], |
| 911 | 'selector' => '{{WRAPPER}} .aux-submenu .aux-menu-item.aux-hover', |
| 912 | ) |
| 913 | ); |
| 914 | |
| 915 | $this->add_group_control( |
| 916 | Group_Control_Text_Shadow::get_type(), |
| 917 | [ |
| 918 | 'name' => 'hover_sub_item_text_shadow', |
| 919 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0 > .aux-submenu > .aux-menu-item.aux-hover > .aux-item-content' |
| 920 | ] |
| 921 | ); |
| 922 | |
| 923 | $this->add_group_control( |
| 924 | Group_Control_Box_Shadow::get_type(), |
| 925 | array( |
| 926 | 'name' => 'hover_sub_item_box_shadow', |
| 927 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0 > .aux-submenu > .aux-menu-item.aux-hover > .aux-item-content' |
| 928 | ) |
| 929 | ); |
| 930 | |
| 931 | $this->add_group_control( |
| 932 | Group_Control_Background::get_type(), |
| 933 | array( |
| 934 | 'name' => 'hover_sub_item_background', |
| 935 | 'label' => __( 'Background', 'auxin-elements' ), |
| 936 | 'types' => array( 'classic', 'gradient' ), |
| 937 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0 > .aux-submenu > .aux-menu-item.aux-hover > .aux-item-content' |
| 938 | ) |
| 939 | ); |
| 940 | |
| 941 | $this->add_responsive_control( |
| 942 | 'sub_item_hover_border_radius', |
| 943 | array( |
| 944 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 945 | 'type' => Controls_Manager::DIMENSIONS, |
| 946 | 'size_units' => array( 'px', 'em', '%' ), |
| 947 | 'selectors' => array( |
| 948 | '{{WRAPPER}} .aux-menu-depth-0 > .aux-submenu > .aux-menu-item.aux-hover > .aux-item-content' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 949 | ), |
| 950 | 'allowed_dimensions' => 'all', |
| 951 | ) |
| 952 | ); |
| 953 | |
| 954 | $this->add_group_control( |
| 955 | Group_Control_Border::get_type(), |
| 956 | array( |
| 957 | 'name' => 'sub_item_hover_border', |
| 958 | 'selector' => '{{WRAPPER}} .aux-menu-depth-0 > .aux-submenu > .aux-menu-item.aux-hover > .aux-item-content', |
| 959 | 'separator' => 'none' |
| 960 | ) |
| 961 | ); |
| 962 | |
| 963 | $this->end_controls_tab(); |
| 964 | |
| 965 | $this->end_controls_tabs(); |
| 966 | |
| 967 | |
| 968 | $this->add_responsive_control( |
| 969 | 'sub_item_padding', |
| 970 | array( |
| 971 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 972 | 'type' => Controls_Manager::DIMENSIONS, |
| 973 | 'size_units' => array( 'px', '%' ), |
| 974 | 'selectors' => array( |
| 975 | '{{WRAPPER}} .aux-submenu .aux-menu-item .aux-item-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 976 | ), |
| 977 | 'separator' => 'before' |
| 978 | ) |
| 979 | ); |
| 980 | |
| 981 | $this->add_responsive_control( |
| 982 | 'sub_item_margin', |
| 983 | array( |
| 984 | 'label' => __( 'Margin', 'auxin-elements' ), |
| 985 | 'type' => Controls_Manager::DIMENSIONS, |
| 986 | 'size_units' => array( 'px', '%' ), |
| 987 | 'selectors' => array( |
| 988 | '{{WRAPPER}} .aux-submenu .aux-menu-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 989 | ), |
| 990 | 'seperator' => 'after' |
| 991 | ) |
| 992 | ); |
| 993 | |
| 994 | $this->end_controls_section(); |
| 995 | |
| 996 | /* Burger Button Section |
| 997 | /*-------------------------------------*/ |
| 998 | |
| 999 | $this->start_controls_section( |
| 1000 | 'burger_section', |
| 1001 | array( |
| 1002 | 'label' => __( 'Burger Button', 'auxin-elements' ), |
| 1003 | 'tab' => Controls_Manager::TAB_STYLE |
| 1004 | ) |
| 1005 | ); |
| 1006 | |
| 1007 | $this->add_control( |
| 1008 | 'burger_type', |
| 1009 | array( |
| 1010 | 'label' => __( 'Type', 'auxin-elements' ), |
| 1011 | 'type' => Controls_Manager::SELECT, |
| 1012 | 'default' => 'default', |
| 1013 | 'options' => array( |
| 1014 | 'default' => __( 'Default', 'auxin-elements' ), |
| 1015 | 'custom' => __( 'Custom', 'auxin-elements' ), |
| 1016 | ), |
| 1017 | ) |
| 1018 | ); |
| 1019 | |
| 1020 | $this->start_controls_tabs( |
| 1021 | 'burger_color', |
| 1022 | array( |
| 1023 | 'condition' => array( |
| 1024 | 'burger_type' => 'default' |
| 1025 | ) |
| 1026 | ) |
| 1027 | ); |
| 1028 | |
| 1029 | $this->start_controls_tab( |
| 1030 | 'burger_color_normal', |
| 1031 | array( |
| 1032 | 'label' => __( 'Normal' , 'auxin-elements' ) |
| 1033 | ) |
| 1034 | ); |
| 1035 | |
| 1036 | $this->add_control( |
| 1037 | 'burger_btn_color', |
| 1038 | array( |
| 1039 | 'label' => __( 'Color', 'auxin-elements' ), |
| 1040 | 'type' => Controls_Manager::COLOR, |
| 1041 | 'selectors' => array( |
| 1042 | '{{WRAPPER}} .aux-burger:before, {{WRAPPER}} .aux-burger:after, {{WRAPPER}} .aux-burger .mid-line' => 'border-color: {{VALUE}} !important;', |
| 1043 | ), |
| 1044 | 'seperartor' => 'after' |
| 1045 | ) |
| 1046 | ); |
| 1047 | |
| 1048 | $this->end_controls_tab(); |
| 1049 | |
| 1050 | $this->start_controls_tab( |
| 1051 | 'burger_color_hover', |
| 1052 | array( |
| 1053 | 'label' => __( 'Hover' , 'auxin-elements' ) |
| 1054 | ) |
| 1055 | ); |
| 1056 | |
| 1057 | $this->add_control( |
| 1058 | 'burger_btn_hover_color', |
| 1059 | array( |
| 1060 | 'label' => __( 'Color', 'auxin-elements' ), |
| 1061 | 'type' => Controls_Manager::COLOR, |
| 1062 | 'selectors' => array( |
| 1063 | '{{WRAPPER}} .aux-burger:hover:before, {{WRAPPER}} .aux-burger:hover:after, {{WRAPPER}} .aux-burger:hover .mid-line' => 'border-color: {{VALUE}} !important;', |
| 1064 | ), |
| 1065 | 'seperartor' => 'after' |
| 1066 | ) |
| 1067 | ); |
| 1068 | |
| 1069 | $this->end_controls_tab(); |
| 1070 | |
| 1071 | $this->end_controls_tabs(); |
| 1072 | |
| 1073 | $this->add_control( |
| 1074 | 'burger_btn_style', |
| 1075 | array( |
| 1076 | 'label' => __('Burger Button Style','auxin-elements' ), |
| 1077 | 'type' => 'aux-visual-select', |
| 1078 | 'style_items' => 'max-width:45%;', |
| 1079 | 'options' => array( |
| 1080 | 'aux-lite-large' => array( |
| 1081 | 'label' => __( 'Expandable under top header', 'auxin-elements' ), |
| 1082 | 'image' => AUXIN_URL . 'images/visual-select/burger-lite-large.svg' |
| 1083 | ), |
| 1084 | 'aux-regular-large' => array( |
| 1085 | 'label' => __( 'Offcanvas panel', 'auxin-elements' ), |
| 1086 | 'image' => AUXIN_URL . 'images/visual-select/burger-regular-large.svg' |
| 1087 | ), |
| 1088 | 'aux-thick-large' => array( |
| 1089 | 'label' => __( 'Offcanvas panel', 'auxin-elements' ), |
| 1090 | 'image' => AUXIN_URL . 'images/visual-select/burger-thick-large.svg' |
| 1091 | ), |
| 1092 | 'aux-lite-medium' => array( |
| 1093 | 'label' => __( 'FullScreen on entire page', 'auxin-elements' ), |
| 1094 | 'image' => AUXIN_URL . 'images/visual-select/burger-lite-medium.svg' |
| 1095 | ), |
| 1096 | 'aux-regular-medium' => array( |
| 1097 | 'label' => __( 'Offcanvas panel', 'auxin-elements' ), |
| 1098 | 'image' => AUXIN_URL . 'images/visual-select/burger-regular-medium.svg' |
| 1099 | ), |
| 1100 | 'aux-thick-medium' => array( |
| 1101 | 'label' => __( 'Offcanvas panel', 'auxin-elements' ), |
| 1102 | 'image' => AUXIN_URL . 'images/visual-select/burger-thick-medium.svg' |
| 1103 | ), |
| 1104 | 'aux-lite-small' => array( |
| 1105 | 'label' => __( 'Offcanvas panel', 'auxin-elements' ), |
| 1106 | 'image' => AUXIN_URL . 'images/visual-select/burger-lite-small.svg' |
| 1107 | ), |
| 1108 | 'aux-regular-small' => array( |
| 1109 | 'label' => __( 'Offcanvas panel', 'auxin-elements' ), |
| 1110 | 'image' => AUXIN_URL . 'images/visual-select/burger-regular-small.svg' |
| 1111 | ), |
| 1112 | 'aux-thick-small' => array( |
| 1113 | 'label' => __( 'Offcanvas panel', 'auxin-elements' ), |
| 1114 | 'image' => AUXIN_URL . 'images/visual-select/burger-thick-small.svg' |
| 1115 | ) |
| 1116 | ), |
| 1117 | 'default' => 'aux-lite-small', |
| 1118 | 'seperator' => 'before', |
| 1119 | 'condition' => array( |
| 1120 | 'burger_type' => 'default' |
| 1121 | ) |
| 1122 | ) |
| 1123 | ); |
| 1124 | |
| 1125 | $this->add_control( |
| 1126 | 'burger_custom', |
| 1127 | array( |
| 1128 | 'label' => '', |
| 1129 | 'type' => Controls_Manager::CODE, |
| 1130 | 'default' => '', |
| 1131 | 'placeholder' => __( 'Enter inline SVG content here', 'auxin-elements' ), |
| 1132 | 'show_label' => false, |
| 1133 | 'condition' => array( |
| 1134 | 'burger_type' => 'custom' |
| 1135 | ) |
| 1136 | ) |
| 1137 | ); |
| 1138 | |
| 1139 | $this->add_control( |
| 1140 | 'burger_offcanvas_menu_bg_color', |
| 1141 | array( |
| 1142 | 'label' => __( 'Off canvas menu background color', 'auxin-elements' ), |
| 1143 | 'type' => Controls_Manager::COLOR, |
| 1144 | 'selectors' => array( |
| 1145 | '{{WRAPPER}} .aux-offcanvas-menu' => 'background-color: {{VALUE}};', |
| 1146 | ), |
| 1147 | ) |
| 1148 | ); |
| 1149 | |
| 1150 | $this->end_controls_section(); |
| 1151 | |
| 1152 | /* Full Screen Menu Section |
| 1153 | /*-------------------------------------*/ |
| 1154 | |
| 1155 | $this->start_controls_section( |
| 1156 | 'fullscr_section', |
| 1157 | array( |
| 1158 | 'label' => __( 'Fullscreen Menu', 'auxin-elements' ), |
| 1159 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1160 | 'condition' => array( |
| 1161 | 'burger_menu_location' => 'overlay' |
| 1162 | ) |
| 1163 | ) |
| 1164 | ); |
| 1165 | |
| 1166 | $this->start_controls_tabs( 'fullscr_item_colors' ); |
| 1167 | |
| 1168 | $this->start_controls_tab( |
| 1169 | 'fullscr_item_color_normal', |
| 1170 | array( |
| 1171 | 'label' => __( 'Normal' , 'auxin-elements' ) |
| 1172 | ) |
| 1173 | ); |
| 1174 | |
| 1175 | $this->add_control( |
| 1176 | 'fullscr_item_color', |
| 1177 | array( |
| 1178 | 'label' => __( 'Color', 'auxin-elements' ), |
| 1179 | 'type' => Controls_Manager::COLOR, |
| 1180 | 'selectors' => array( |
| 1181 | '{{WRAPPER}} .aux-fs-menu .aux-menu-item > .aux-item-content' => 'color: {{VALUE}};', |
| 1182 | ), |
| 1183 | 'seperartor' => 'after' |
| 1184 | ) |
| 1185 | ); |
| 1186 | |
| 1187 | $this->add_group_control( |
| 1188 | Group_Control_Typography::get_type(), |
| 1189 | array( |
| 1190 | 'name' => 'fullscr_menu_item_typo', |
| 1191 | 'global' => [ |
| 1192 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1193 | ], |
| 1194 | 'selector' => '{{WRAPPER}} .aux-fs-menu .aux-menu-item > .aux-item-content', |
| 1195 | ) |
| 1196 | ); |
| 1197 | |
| 1198 | $this->add_group_control( |
| 1199 | Group_Control_Text_Shadow::get_type(), |
| 1200 | [ |
| 1201 | 'name' => 'fullscr_item_text_shadow', |
| 1202 | 'selector' => '{{WRAPPER}} .aux-fs-menu .aux-menu-item > .aux-item-content' |
| 1203 | ] |
| 1204 | ); |
| 1205 | |
| 1206 | $this->add_group_control( |
| 1207 | Group_Control_Box_Shadow::get_type(), |
| 1208 | array( |
| 1209 | 'name' => 'fullscr_item_box_shadow', |
| 1210 | 'selector' => '{{WRAPPER}} .aux-fs-menu .aux-menu-item' |
| 1211 | ) |
| 1212 | ); |
| 1213 | |
| 1214 | $this->add_group_control( |
| 1215 | Group_Control_Background::get_type(), |
| 1216 | array( |
| 1217 | 'name' => 'fullscr_item_background', |
| 1218 | 'label' => __( 'Background', 'auxin-elements' ), |
| 1219 | 'types' => array( 'classic', 'gradient' ), |
| 1220 | 'selector' => '{{WRAPPER}} .aux-fs-menu .aux-menu-item ' |
| 1221 | ) |
| 1222 | ); |
| 1223 | |
| 1224 | $this->add_responsive_control( |
| 1225 | 'fullscr_item_border_radius', |
| 1226 | array( |
| 1227 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 1228 | 'type' => Controls_Manager::DIMENSIONS, |
| 1229 | 'size_units' => array( 'px', 'em', '%' ), |
| 1230 | 'selectors' => array( |
| 1231 | '{{WRAPPER}} .aux-fs-menu .aux-menu-item' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1232 | ), |
| 1233 | 'allowed_dimensions' => 'all', |
| 1234 | ) |
| 1235 | ); |
| 1236 | |
| 1237 | $this->add_group_control( |
| 1238 | Group_Control_Border::get_type(), |
| 1239 | array( |
| 1240 | 'name' => 'fullscr_item_border', |
| 1241 | 'selector' => '{{WRAPPER}} .aux-fs-menu .aux-menu-item', |
| 1242 | 'separator' => 'none' |
| 1243 | ) |
| 1244 | ); |
| 1245 | |
| 1246 | $this->end_controls_tab(); |
| 1247 | |
| 1248 | $this->start_controls_tab( |
| 1249 | 'fullscr_item_color_hover', |
| 1250 | array( |
| 1251 | 'label' => __( 'Hover' , 'auxin-elements' ) |
| 1252 | ) |
| 1253 | ); |
| 1254 | |
| 1255 | $this->add_control( |
| 1256 | 'fullscr_item_hover_color', |
| 1257 | array( |
| 1258 | 'label' => __( 'Color', 'auxin-elements' ), |
| 1259 | 'type' => Controls_Manager::COLOR, |
| 1260 | 'selectors' => array( |
| 1261 | '{{WRAPPER}} .aux-fs-menu .aux-menu-item.aux-hover > .aux-item-content' => 'color: {{VALUE}} !important;' |
| 1262 | ), |
| 1263 | 'seperartor' => 'after' |
| 1264 | ) |
| 1265 | ); |
| 1266 | |
| 1267 | $this->add_group_control( |
| 1268 | Group_Control_Typography::get_type(), |
| 1269 | array( |
| 1270 | 'name' => 'fullscr_menu_item_typo_hover', |
| 1271 | 'global' => [ |
| 1272 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1273 | ], |
| 1274 | 'selector' => '{{WRAPPER}} .aux-fs-menu .aux-menu-item.aux-hover > .aux-item-content', |
| 1275 | ) |
| 1276 | ); |
| 1277 | |
| 1278 | $this->add_group_control( |
| 1279 | Group_Control_Text_Shadow::get_type(), |
| 1280 | [ |
| 1281 | 'name' => 'fullscr_hover_item_text_shadow', |
| 1282 | 'selector' => '{{WRAPPER}} .aux-fs-menu .aux-menu-item.aux-hover > .aux-item-content' |
| 1283 | ] |
| 1284 | ); |
| 1285 | |
| 1286 | $this->add_group_control( |
| 1287 | Group_Control_Box_Shadow::get_type(), |
| 1288 | array( |
| 1289 | 'name' => 'fullscr_hover_item_box_shadow', |
| 1290 | 'selector' => '{{WRAPPER}} .aux-fs-menu .aux-menu-item.aux-hover' |
| 1291 | ) |
| 1292 | ); |
| 1293 | |
| 1294 | $this->add_group_control( |
| 1295 | Group_Control_Background::get_type(), |
| 1296 | array( |
| 1297 | 'name' => 'fullscr_hover_item_background', |
| 1298 | 'label' => __( 'Background', 'auxin-elements' ), |
| 1299 | 'types' => array( 'classic', 'gradient' ), |
| 1300 | 'selector' => '{{WRAPPER}} .aux-fs-menu .aux-menu-item.aux-hover' |
| 1301 | ) |
| 1302 | ); |
| 1303 | |
| 1304 | $this->add_responsive_control( |
| 1305 | 'fullscr_item_hover_border_radius', |
| 1306 | array( |
| 1307 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 1308 | 'type' => Controls_Manager::DIMENSIONS, |
| 1309 | 'size_units' => array( 'px', 'em', '%' ), |
| 1310 | 'selectors' => array( |
| 1311 | '{{WRAPPER}} .aux-fs-menu .aux-menu-item.aux-hover' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1312 | ), |
| 1313 | 'allowed_dimensions' => 'all', |
| 1314 | 'separator' => 'after' |
| 1315 | ) |
| 1316 | ); |
| 1317 | |
| 1318 | $this->add_group_control( |
| 1319 | Group_Control_Border::get_type(), |
| 1320 | array( |
| 1321 | 'name' => 'fullscr_item_hover_border', |
| 1322 | 'selector' => '{{WRAPPER}} .aux-fs-menu .aux-menu-item.aux-hover', |
| 1323 | 'separator' => 'none' |
| 1324 | ) |
| 1325 | ); |
| 1326 | |
| 1327 | $this->end_controls_tab(); |
| 1328 | |
| 1329 | $this->end_controls_tabs(); |
| 1330 | |
| 1331 | $this->add_responsive_control( |
| 1332 | 'fullscr_item_padding', |
| 1333 | array( |
| 1334 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 1335 | 'type' => Controls_Manager::DIMENSIONS, |
| 1336 | 'size_units' => array( 'px', '%' ), |
| 1337 | 'selectors' => array( |
| 1338 | '{{WRAPPER}} .aux-fs-menu .aux-menu-item > .aux-item-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1339 | ), |
| 1340 | 'separator' => 'before' |
| 1341 | ) |
| 1342 | ); |
| 1343 | |
| 1344 | $this->add_responsive_control( |
| 1345 | 'fullscr_item_margin', |
| 1346 | array( |
| 1347 | 'label' => __( 'Margin', 'auxin-elements' ), |
| 1348 | 'type' => Controls_Manager::DIMENSIONS, |
| 1349 | 'size_units' => array( 'px', '%' ), |
| 1350 | 'selectors' => array( |
| 1351 | '{{WRAPPER}} .aux-fs-menu .aux-menu-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1352 | ), |
| 1353 | 'seperator' => 'after' |
| 1354 | ) |
| 1355 | ); |
| 1356 | |
| 1357 | $this->add_responsive_control( |
| 1358 | 'fullscr_align', |
| 1359 | array( |
| 1360 | 'label' => __('Text Align','auxin-elements'), |
| 1361 | 'type' => Controls_Manager::CHOOSE, |
| 1362 | 'devices' => array( 'desktop', 'mobile' ), |
| 1363 | 'options' => array( |
| 1364 | 'left' => array( |
| 1365 | 'title' => __( 'Left', 'auxin-elements' ), |
| 1366 | 'icon' => 'eicon-text-align-left', |
| 1367 | ), |
| 1368 | 'center' => array( |
| 1369 | 'title' => __( 'Center', 'auxin-elements' ), |
| 1370 | 'icon' => 'eicon-text-align-center', |
| 1371 | ), |
| 1372 | 'right' => array( |
| 1373 | 'title' => __( 'Right', 'auxin-elements' ), |
| 1374 | 'icon' => 'eicon-text-align-right', |
| 1375 | ), |
| 1376 | ), |
| 1377 | 'default' => 'left', |
| 1378 | 'toggle' => true, |
| 1379 | 'selectors' => array( |
| 1380 | '{{WRAPPER}} .aux-fs-menu .aux-master-menu' => 'text-align: {{VALUE}}', |
| 1381 | ), |
| 1382 | 'separator' => 'after' |
| 1383 | ) |
| 1384 | ); |
| 1385 | |
| 1386 | $this->add_control( |
| 1387 | 'fullscr_current_item_color', |
| 1388 | array( |
| 1389 | 'label' => __( 'Main Menu Color', 'auxin-elements' ), |
| 1390 | 'type' => Controls_Manager::COLOR, |
| 1391 | 'selectors' => array( |
| 1392 | '{{WRAPPER}} .aux-fs-menu .aux-menu-depth-0.current-menu-item > a' => 'color: {{VALUE}};' |
| 1393 | ) |
| 1394 | ) |
| 1395 | ); |
| 1396 | |
| 1397 | $this->add_group_control( |
| 1398 | Group_Control_Typography::get_type(), |
| 1399 | array( |
| 1400 | 'name' => 'fullscr_current_item_typography', |
| 1401 | 'global' => [ |
| 1402 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1403 | ], |
| 1404 | 'selector' => '{{WRAPPER}} .aux-fs-menu .aux-menu-depth-0.current-menu-item > a' |
| 1405 | ) |
| 1406 | ); |
| 1407 | |
| 1408 | $this->add_group_control( |
| 1409 | Group_Control_Text_Shadow::get_type(), |
| 1410 | [ |
| 1411 | 'name' => 'fullscr_current_item_text_shadow', |
| 1412 | 'selector' => '{{WRAPPER}} .aux-fs-menu .aux-menu-depth-0.current-menu-item > a', |
| 1413 | 'separator' => 'after' |
| 1414 | ] |
| 1415 | ); |
| 1416 | |
| 1417 | $this->end_controls_section(); |
| 1418 | |
| 1419 | |
| 1420 | /* Full Screen Window |
| 1421 | /*-------------------------------------*/ |
| 1422 | |
| 1423 | $this->start_controls_section( |
| 1424 | 'fullscr_window', |
| 1425 | array( |
| 1426 | 'label' => __( 'Fullscreen Window', 'auxin-elements' ), |
| 1427 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1428 | 'condition' => array( |
| 1429 | 'burger_menu_location' => 'overlay' |
| 1430 | ) |
| 1431 | ) |
| 1432 | ); |
| 1433 | |
| 1434 | $this->add_group_control( |
| 1435 | Group_Control_Background::get_type(), |
| 1436 | array( |
| 1437 | 'name' => 'fullscr_bg', |
| 1438 | 'label' => __( 'Background', 'auxin-elements' ), |
| 1439 | 'types' => array( 'classic', 'gradient' ), |
| 1440 | 'selector' => '{{WRAPPER}} .aux-fs-popup' |
| 1441 | ) |
| 1442 | ); |
| 1443 | |
| 1444 | $this->add_control( |
| 1445 | 'fullscr_close_btn_heading', |
| 1446 | [ |
| 1447 | 'label' => __( 'Close Button', 'auxin-elements' ), |
| 1448 | 'type' => Controls_Manager::HEADING, |
| 1449 | 'separator'=> 'before' |
| 1450 | ] |
| 1451 | ); |
| 1452 | |
| 1453 | $this->add_control( |
| 1454 | 'fullscr_close_btn_border_color', |
| 1455 | [ |
| 1456 | 'label' => __( 'Close button outline color', 'auxin-elements' ), |
| 1457 | 'type' => Controls_Manager::COLOR, |
| 1458 | 'selectors' => [ |
| 1459 | '{{WRAPPER}} .aux-fs-popup .aux-panel-close' => 'border-color: {{VALUE}};' |
| 1460 | ] |
| 1461 | ] |
| 1462 | ); |
| 1463 | |
| 1464 | $this->add_control( |
| 1465 | 'fullscr_close_btn_symbol_color', |
| 1466 | [ |
| 1467 | 'label' => __( 'Close button symbol color', 'auxin-elements' ), |
| 1468 | 'type' => Controls_Manager::COLOR, |
| 1469 | 'selectors' => [ |
| 1470 | '{{WRAPPER}} .aux-fs-popup .aux-panel-close .aux-close:before' => 'background-color: {{VALUE}};', |
| 1471 | '{{WRAPPER}} .aux-fs-popup .aux-panel-close .aux-close:after' => 'background-color: {{VALUE}};' |
| 1472 | ], |
| 1473 | 'separator'=> 'after' |
| 1474 | ] |
| 1475 | ); |
| 1476 | |
| 1477 | $this->add_control( |
| 1478 | 'fullscr_window_has_title', |
| 1479 | array( |
| 1480 | 'label' => __( 'Display Menu Title', 'auxin-elements' ), |
| 1481 | 'type' => Controls_Manager::SWITCHER, |
| 1482 | 'label_on' => __( 'Show', 'auxin-elements' ), |
| 1483 | 'label_off' => __( 'Hide', 'auxin-elements' ), |
| 1484 | ) |
| 1485 | ); |
| 1486 | |
| 1487 | $this->add_control( |
| 1488 | 'fullscr_window_title_text', |
| 1489 | array( |
| 1490 | 'label' => __('Menu Title Text','auxin-elements' ), |
| 1491 | 'type' => Controls_Manager::TEXT, |
| 1492 | 'default' => '', |
| 1493 | 'condition' => array( |
| 1494 | 'fullscr_window_has_title' => 'yes' |
| 1495 | ) |
| 1496 | ) |
| 1497 | ); |
| 1498 | |
| 1499 | $this->add_group_control( |
| 1500 | Group_Control_Typography::get_type(), |
| 1501 | array( |
| 1502 | 'name' => 'fullscr_window_title_typo', |
| 1503 | 'label' => __( 'Menu Title Typography', 'auxin-elements' ), |
| 1504 | 'global' => [ |
| 1505 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1506 | ], |
| 1507 | 'selector' => '{{WRAPPER}} .aux-has-menu-title .aux-fs-menu:before', |
| 1508 | 'condition' => array( |
| 1509 | 'fullscr_window_has_title' => 'yes' |
| 1510 | ) |
| 1511 | ) |
| 1512 | ); |
| 1513 | |
| 1514 | $this->add_control( |
| 1515 | 'fullscr_window_title_color', |
| 1516 | [ |
| 1517 | 'label' => __( 'Menu Title Color', 'auxin-elements' ), |
| 1518 | 'type' => Controls_Manager::COLOR, |
| 1519 | 'selectors' => [ |
| 1520 | '{{WRAPPER}} .aux-has-menu-title .aux-fs-menu:before' => 'color: {{VALUE}};' |
| 1521 | ], |
| 1522 | 'condition' => array( |
| 1523 | 'fullscr_window_has_title' => 'yes' |
| 1524 | ) |
| 1525 | ] |
| 1526 | ); |
| 1527 | |
| 1528 | $this->end_controls_section(); |
| 1529 | |
| 1530 | } |
| 1531 | |
| 1532 | /** |
| 1533 | * Render MenuBox widget output on the frontend. |
| 1534 | * |
| 1535 | * Written in PHP and used to generate the final HTML. |
| 1536 | * |
| 1537 | * @since 1.0.0 |
| 1538 | * @access protected |
| 1539 | */ |
| 1540 | protected function render() { |
| 1541 | $settings = $this->get_settings_for_display(); |
| 1542 | |
| 1543 | if ( ! isset( $settings['menu_slug'] ) ) { |
| 1544 | return esc_html_e( 'Please choose a menu.', 'auxin-elements' ) ; |
| 1545 | } |
| 1546 | |
| 1547 | if ( empty( wp_get_nav_menu_object( $settings['menu_slug'] ) ) || ! wp_get_nav_menu_object( $settings['menu_slug'] )->count ) { |
| 1548 | return esc_html_e( 'There are no menu items in this menu.', 'auxin-elements' ) ; |
| 1549 | } |
| 1550 | |
| 1551 | $offcanvas_output = ''; |
| 1552 | $fullscreen_output = ''; |
| 1553 | $toggle_bar_output = ''; |
| 1554 | |
| 1555 | $indicator = auxin_is_true( $settings['indicator'] ); |
| 1556 | $splitter = auxin_is_true( $settings['splitter'] ); |
| 1557 | |
| 1558 | |
| 1559 | $menu_class = ''; |
| 1560 | $menu_class .= ' aux-skin-' . $settings['submenu_skin'] ; |
| 1561 | $menu_class .= 'none' !== $settings['submenu_anim'] ? ' aux-' . $settings['submenu_anim'] . '-nav' : ''; |
| 1562 | $menu_class .= $indicator ? ' aux-with-indicator' : ''; |
| 1563 | $menu_class .= $splitter ? ' aux-with-splitter' : ''; |
| 1564 | |
| 1565 | |
| 1566 | $mobile_menu_target = '.elementor-element-' . $this->get_id(); |
| 1567 | |
| 1568 | switch( $settings['burger_menu_location'] ) { |
| 1569 | case 'overlay': |
| 1570 | $fullscreen_menu_title = auxin_is_true( $settings['fullscr_window_has_title'] ) && |
| 1571 | ! empty( $settings['fullscr_window_title_text'] ) ? $settings['fullscr_window_title_text'] : ''; |
| 1572 | $fullscreen_popup_classes = 'aux-fs-popup aux-fs-menu-layout-center aux-indicator'; |
| 1573 | $fullscreen_popup_classes .= ! empty( $fullscreen_menu_title ) ? ' aux-has-menu-title' : ''; |
| 1574 | |
| 1575 | $fullscreen_output = '<section class="'.esc_attr( $fullscreen_popup_classes ).'">'; |
| 1576 | $fullscreen_output .= '<div class="aux-panel-close"><div class="aux-close aux-cross-symbol aux-thick-medium"></div></div>'; |
| 1577 | $fullscreen_output .= '<div class="aux-fs-menu" data-menu-title="'.esc_attr( $fullscreen_menu_title ).'"></div>'; |
| 1578 | $fullscreen_output .= '</section>'; |
| 1579 | $mobile_menu_target .= ' .aux-fs-popup .aux-fs-menu'; |
| 1580 | break; |
| 1581 | |
| 1582 | case 'offcanvas': |
| 1583 | $offcanvas_output = '<section class="aux-offcanvas-menu aux-pin-' . esc_attr( $settings['offcanvas_align'] ) . '">'; |
| 1584 | $offcanvas_output .= '<div class="aux-panel-close"><div class="aux-close aux-cross-symbol aux-thick-medium"></div></div>'; |
| 1585 | $offcanvas_output .= '<div class="offcanvas-header"></div>'; |
| 1586 | $offcanvas_output .= '<div class="offcanvas-content"></div>'; |
| 1587 | $offcanvas_output .= '<div class="offcanvas-footer"></div>'; |
| 1588 | $offcanvas_output .= '</section>'; |
| 1589 | $mobile_menu_target .= ' .aux-offcanvas-menu .offcanvas-content'; |
| 1590 | break; |
| 1591 | |
| 1592 | case 'toggle-bar': |
| 1593 | $toggle_bar_output = '<div class="aux-toggle-menu-bar"></div>'; |
| 1594 | $mobile_menu_target .= ' .aux-toggle-menu-bar'; |
| 1595 | break; |
| 1596 | |
| 1597 | default: |
| 1598 | |
| 1599 | } |
| 1600 | |
| 1601 | printf( '<div class="aux-elementor-header-menu aux-nav-menu-element aux-nav-menu-element-%s">', esc_attr( $this->get_id() ) ); |
| 1602 | |
| 1603 | if ( 'default' === $settings['burger_type'] ) { |
| 1604 | $burger_content = '<div class="aux-burger ' . esc_attr( $settings['burger_btn_style'] ) . '"><span class="mid-line"></span></div>'; |
| 1605 | } else { |
| 1606 | $burger_custom = preg_replace( '/<script\b[^>]*>.*?<\/script>/is', '', $settings['burger_custom'] ); |
| 1607 | $burger_content = '<div class="aux-burger aux-custom-burger">' . $burger_custom . '</div>'; |
| 1608 | } |
| 1609 | |
| 1610 | $burger_btn_output = printf( '<div class="aux-burger-box" data-target-panel="%s" data-target-content="%s">%s</div>', |
| 1611 | esc_attr( $settings['burger_menu_location'] ), |
| 1612 | '.elementor-element-' . esc_attr( $this->get_id() ) . ' .aux-master-menu', |
| 1613 | $burger_content |
| 1614 | ); |
| 1615 | |
| 1616 | $breakpoint = ( 'custom' === $settings['display_burger'] && !empty( $settings['breakpoint']['size'] ) ) ? $settings['breakpoint']['size'] : $settings['display_burger']; |
| 1617 | |
| 1618 | wp_nav_menu( array( |
| 1619 | 'container_id' => 'master-menu-elementor-'. $this->get_id(), |
| 1620 | 'menu' => $settings['menu_slug'], |
| 1621 | 'direction' => 'burger' === $settings['type'] ? null : $settings['type'], |
| 1622 | 'mobile_under' => 'burger' === $settings['type'] ? 9000 : $breakpoint, |
| 1623 | 'mobile_menu_type' => $settings['burger_toggle_type'], |
| 1624 | 'mobile_menu_target' => $mobile_menu_target, |
| 1625 | 'theme_location' => 'element', |
| 1626 | 'extra_class' => esc_attr( $menu_class ), |
| 1627 | 'fallback_cb' => 'wp_page_menu' |
| 1628 | )); |
| 1629 | |
| 1630 | echo wp_kses_post( $offcanvas_output ); |
| 1631 | echo wp_kses_post( $fullscreen_output ); |
| 1632 | echo wp_kses_post( $toggle_bar_output ); |
| 1633 | |
| 1634 | echo '</div>'; |
| 1635 | |
| 1636 | if ( 'burger' !== $settings['type'] ) { |
| 1637 | printf( '<style>@media only screen and (min-width: %spx) { .elementor-element-%s .aux-burger-box { display: none } }</style>', (int)$breakpoint + 1, esc_attr( $this->get_id() ) ); |
| 1638 | } |
| 1639 | |
| 1640 | } |
| 1641 | |
| 1642 | } |
| 1643 |