enter', ), 'right' => array( 'title' => esc_html__( 'Right', 'jet-menu' ), 'icon' => 'fa fa-align-right', ), ), 'selectors_dictionary' => $arrow_hor_pos_selectors_dictionary, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme[ $prefix . 'arrow' ] => '{{VALUE}}', ), ) ); $this->add_control( $prefix . 'arrow_ver_position', array( 'label' => esc_html__( 'Vertical position', 'jet-menu' ), 'type' => Controls_Manager::CHOOSE, 'options' => array( 'top' => array( 'title' => esc_html__( 'Top', 'jet-menu' ), 'icon' => 'eicon-v-align-top', ), 'center' => array( 'title' => esc_html__( 'Center', 'jet-menu' ), 'icon' => 'eicon-v-align-middle', ), 'bottom' => array( 'title' => esc_html__( 'Bottom', 'jet-menu' ), 'icon' => 'eicon-v-align-bottom', ), ), 'selectors_dictionary' => array( 'top' => 'flex: 0 0 100%; width: 0; order: -2;', 'center' => 'align-self: center; flex: 0 0 auto; width: auto;', 'bottom' => 'flex: 0 0 100%; width: 0; order: 2;', ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme[ $prefix . 'arrow' ] => '{{VALUE}}', ), ) ); $this->add_control( $prefix . 'arrow_order', array( 'label' => esc_html__( 'Order', 'jet-menu' ), 'type' => Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => -10, 'max' => 10, ), ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme[ $prefix . 'arrow' ] => 'order: {{SIZE}};', ), ) ); $this->end_controls_tab(); } $this->end_controls_tabs(); $this->end_controls_section(); /** * Toggle Style Section */ $this->start_controls_section( 'section_mobile_menu_toggle_style', array( 'label' => esc_html__( 'Mobile Toggle', 'jet-menu' ), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, ) ); $this->add_control( 'mobile_toggle_color', array( 'label' => esc_html__( 'Icon Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['toggle'] . ' .jet-mobile-menu__toggle-icon' => 'color: {{VALUE}}', ), ) ); $this->add_responsive_control( 'toggle_icon_size', array( 'label' => esc_html__( 'Icon Size', 'jet-menu' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', ), 'range' => array( 'px' => array( 'min' => 8, 'max' => 100, ), ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['toggle'] . ' .jet-mobile-menu__toggle-icon i' => 'font-size: {{SIZE}}{{UNIT}}', '{{WRAPPER}} ' . $css_scheme['toggle'] . ' .jet-mobile-menu__toggle-icon svg' => 'width: {{SIZE}}{{UNIT}}', ), ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'mobile_toggle_bg_color', 'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'], ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'toggle_border', 'label' => esc_html__( 'Border', 'jet-menu' ), 'placeholder' => '1px', 'default' => '1px', 'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'], ) ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), array( 'name' => 'toggle_box_shadow', 'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'], ) ); $this->add_control( 'toggle_padding', array( 'label' => esc_html__( 'Padding', 'jet-menu' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['toggle'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_control( 'toggle_border_radius', array( 'label' => esc_html__( 'Border Radius', 'jet-menu' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['toggle'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_control( 'menu_toggle_text_heading', array( 'label' => esc_html__( 'Toggle Text', 'jet-menu' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => array( 'toggle_text!' => '', ), ) ); $this->add_control( 'toggle_text_color', array( 'label' => esc_html__( 'Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['toggle'] . ' .jet-mobile-menu__toggle-text' => 'color: {{VALUE}}', ), 'condition' => array( 'toggle_text!' => '', ), ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'toggle_text_typography', 'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'] . ' .jet-mobile-menu__toggle-text', 'condition' => array( 'toggle_text!' => '', ), ) ); $this->end_controls_section(); /** * Container Style Section */ $this->start_controls_section( 'section_mobile_menu_container_style', array( 'label' => esc_html__( 'Mobile Container', 'jet-menu' ), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, ) ); $this->add_control( 'menu_container_navi_controls_heading', array( 'label' => esc_html__( 'Navigation Controls', 'jet-menu' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ) ); $this->add_control( 'navi_controls_padding', array( 'label' => esc_html__( 'Padding', 'jet-menu' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['mobile_container'] . ' .jet-mobile-menu__controls' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'navi_controls_border', 'label' => esc_html__( 'Border', 'jet-menu' ), 'selector' => '{{WRAPPER}} ' . $css_scheme['mobile_container'] . ' .jet-mobile-menu__controls', ) ); $this->add_control( 'menu_container_icons_heading', array( 'label' => esc_html__( 'Controls Styles', 'jet-menu' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ) ); $this->add_control( 'container_close_icon_color', array( 'label' => esc_html__( 'Close/Back Icon Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['mobile_container'] . ' .jet-mobile-menu__back i' => 'color: {{VALUE}}', '{{WRAPPER}} ' . $css_scheme['mobile_container'] . ' .jet-mobile-menu__back svg' => 'color: {{VALUE}}', ), ) ); $this->add_responsive_control( 'container_close_icon_size', array( 'label' => esc_html__( 'Close/Back Icon Size', 'jet-menu' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', ), 'range' => array( 'px' => array( 'min' => 8, 'max' => 100, ), ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['mobile_container'] . ' .jet-mobile-menu__back i' => 'font-size: {{SIZE}}{{UNIT}}', ), ) ); $this->add_control( 'container_back_text_color', array( 'label' => esc_html__( 'Back Text Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['mobile_container'] . ' .jet-mobile-menu__back span' => 'color: {{VALUE}}', ), 'condition' => array( 'back_text!' => '', ), ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'back_text_typography', 'selector' => '{{WRAPPER}} ' . $css_scheme['mobile_container'] . ' .jet-mobile-menu__back span', 'condition' => array( 'back_text!' => '', ), ) ); $this->add_control( 'menu_container_breadcrums_heading', array( 'label' => esc_html__( 'Breadcrumbs', 'jet-menu' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => array( 'use_breadcrumbs' => 'yes', ), ) ); $this->add_control( 'breadcrums_text_color', array( 'label' => esc_html__( 'Text Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['breadcrumbs'] . ' .breadcrumb-label' => 'color: {{VALUE}}', ), 'condition' => array( 'use_breadcrumbs' => 'yes', ), ) ); $this->add_control( 'breadcrums_icon_color', array( 'label' => esc_html__( 'Divider Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['breadcrumbs'] . ' .breadcrumb-divider' => 'color: {{VALUE}}', ), 'condition' => array( 'use_breadcrumbs' => 'yes', ), ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'breadcrums_text_typography', 'selector' => '{{WRAPPER}} ' . $css_scheme['breadcrumbs'] . ' .breadcrumb-label', 'condition' => array( 'use_breadcrumbs' => 'yes', ), ) ); $this->add_responsive_control( 'breadcrums_icon_size', array( 'label' => esc_html__( 'Divider Size', 'jet-menu' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', ), 'range' => array( 'px' => array( 'min' => 8, 'max' => 100, ), ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['breadcrumbs'] . ' .breadcrumb-divider i' => 'font-size: {{SIZE}}{{UNIT}}', '{{WRAPPER}} ' . $css_scheme['breadcrumbs'] . ' .breadcrumb-divider svg' => 'width: {{SIZE}}{{UNIT}}', ), 'condition' => array( 'use_breadcrumbs' => 'yes', ), ) ); $this->add_control( 'menu_container_box_heading', array( 'label' => esc_html__( 'Container Box', 'jet-menu' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ) ); $this->add_responsive_control( 'container_width', array( 'label' => esc_html__( 'Container Width', 'jet-menu' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', '%' ), 'range' => array( 'px' => array( 'min' => 300, 'max' => 1000, ), '%' => array( 'min' => 10, 'max' => 100, ), ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['mobile_container'] => 'width: {{SIZE}}{{UNIT}}', ), ) ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'mobile_container_bg_color', 'selector' => '{{WRAPPER}} ' . $css_scheme['mobile_container'] . ' .jet-mobile-menu__container-inner', ) ); $this->add_group_control( Group_Control_Border::get_type(), array( 'name' => 'container_border', 'label' => esc_html__( 'Border', 'jet-menu' ), 'selector' => '{{WRAPPER}} ' . $css_scheme['mobile_container'] . ' .jet-mobile-menu__container-inner', ) ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), array( 'name' => 'container_box_shadow', 'selector' => '{{WRAPPER}} ' . $css_scheme['mobile_container'], ) ); $this->add_control( 'container_padding', array( 'label' => esc_html__( 'Padding', 'jet-menu' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['mobile_container'] . ' .jet-mobile-menu__container-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_control( 'container_border_radius', array( 'label' => esc_html__( 'Border Radius', 'jet-menu' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['mobile_container'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} ' . $css_scheme['mobile_container'] . ' .jet-mobile-menu__container-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_responsive_control( 'container_z_index', array( 'label' => esc_html__( 'Z Index', 'jet-menu' ), 'type' => Controls_Manager::NUMBER, 'min' => -999, 'max' => 99999, 'default' => 999, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['mobile_container'] => 'z-index: {{VALUE}}', '{{WRAPPER}} ' . $css_scheme['widget_instance'] . ' .jet-mobile-menu-cover' => 'z-index: calc({{VALUE}}-1)', ), ) ); $this->add_control( 'menu_container_box_header_template_heading', array( 'label' => esc_html__( 'Header Template', 'jet-menu' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => array( 'item_header_template!' => '', ), ) ); $this->add_control( 'header_template_padding', array( 'label' => esc_html__( 'Padding', 'jet-menu' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['mobile_container'] . ' .jet-mobile-menu__header-template' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), 'condition' => array( 'item_header_template!' => '', ), ) ); $this->add_control( 'menu_container_box_before_template_heading', array( 'label' => esc_html__( 'Before Template', 'jet-menu' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => array( 'item_before_template!' => '', ), ) ); $this->add_control( 'before_template_padding', array( 'label' => esc_html__( 'Padding', 'jet-menu' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['mobile_container'] . ' .jet-mobile-menu__before-template' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), 'condition' => array( 'item_before_template!' => '', ), ) ); $this->add_control( 'menu_container_box_after_template_heading', array( 'label' => esc_html__( 'After Template', 'jet-menu' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => array( 'item_after_template!' => '', ), ) ); $this->add_control( 'after_template_padding', array( 'label' => esc_html__( 'Padding', 'jet-menu' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['mobile_container'] . ' .jet-mobile-menu__after-template' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), 'condition' => array( 'item_after_template!' => '', ), ) ); $this->end_controls_section(); /** * Items Style Section */ $this->start_controls_section( 'section_mobile_menu_items_style', array( 'label' => esc_html__( 'Mobile Items', 'jet-menu' ), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, ) ); $this->add_control( 'menu_item_label_icon', array( 'label' => esc_html__( 'Icon', 'jet-menu' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => array( 'is_item_icon' => 'yes', ), ) ); $this->add_responsive_control( 'menu_item_icon_size', array( 'label' => esc_html__( 'Size', 'jet-menu' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'range' => array( 'px' => array( 'min' => 8, 'max' => 100, ), ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-menu-icon' => 'font-size: {{SIZE}}{{UNIT}}; min-width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-menu-icon svg' => 'width: {{SIZE}}{{UNIT}}', ), 'condition' => array( 'is_item_icon' => 'yes', ), ) ); $this->add_control( 'menu_item_icon_ver_position', array( 'label' => esc_html__( 'Vertical Aligment', 'jet-menu' ), 'type' => Controls_Manager::SELECT, 'default' => 'center', 'options' => array( 'flex-start' => esc_html__( 'Top', 'jet-menu' ), 'center' => esc_html__( 'Center', 'jet-menu' ), 'flex-end' => esc_html__( 'Bottom', 'jet-menu' ), ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-menu-icon' => 'align-self: {{VALUE}}', ), 'condition' => array( 'is_item_icon' => 'yes', ), ) ); $this->add_control( 'menu_item_icon_hor_position', array( 'label' => esc_html__( 'Horizontal Aligment', 'jet-menu' ), 'type' => Controls_Manager::SELECT, 'default' => 'center', 'options' => array( 'flex-start' => esc_html__( 'Left', 'jet-menu' ), 'center' => esc_html__( 'Center', 'jet-menu' ), 'flex-end' => esc_html__( 'Right', 'jet-menu' ), ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-menu-icon' => 'justify-content: {{VALUE}}', ), 'condition' => array( 'is_item_icon' => 'yes', ), ) ); $this->add_control( 'menu_item_label_heading', array( 'label' => esc_html__( 'Label', 'jet-menu' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'label' => esc_html__( 'Label Typography', 'jet-menu' ), 'name' => 'item_label_typography', 'selector' => '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-menu-label', ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'label' => esc_html__( 'Sub Label Typography', 'jet-menu' ), 'name' => 'item_sub_label_typography', 'selector' => '{{WRAPPER}} ' . $css_scheme['item'] . ' .mobile-sub-level-link .jet-menu-label', 'condition' => array( 'sub-open-layout' => 'dropdown', ), ) ); $this->add_control( 'menu_item_padding', array( 'label' => esc_html__( 'Padding', 'jet-menu' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_control( 'menu_item_desc_heading', array( 'label' => esc_html__( 'Description', 'jet-menu' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => array( 'is_item_desc' => 'yes', ), ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'item_desc_typography', 'selector' => '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-menu-desc', 'condition' => array( 'is_item_desc' => 'yes', ), ) ); $this->add_control( 'menu_item_badge_heading', array( 'label' => esc_html__( 'Badge', 'jet-menu' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => array( 'is_item_badge' => 'yes', ), ) ); $this->add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'item_badge_typography', 'selector' => '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-menu-badge__inner', 'condition' => array( 'is_item_badge' => 'yes', ), ) ); $this->add_control( 'menu_item_badge_ver_position', array( 'label' => esc_html__( 'Vertical Position', 'jet-menu' ), 'type' => Controls_Manager::SELECT, 'default' => 'flex-start', 'options' => array( 'flex-start' => esc_html__( 'Top', 'jet-menu' ), 'center' => esc_html__( 'Center', 'jet-menu' ), 'flex-end' => esc_html__( 'Bottom', 'jet-menu' ), ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-menu-badge' => 'align-self: {{VALUE}}', ), 'condition' => array( 'is_item_badge' => 'yes', ), ) ); $this->add_control( 'menu_item_badge_padding', array( 'label' => esc_html__( 'Padding', 'jet-menu' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-menu-badge__inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), 'condition' => array( 'is_item_badge' => 'yes', ), ) ); $this->add_control( 'menu_item_badge_border_radius', array( 'label' => esc_html__( 'Border Radius', 'jet-menu' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-menu-badge__inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), 'condition' => array( 'is_item_badge' => 'yes', ), ) ); $this->add_control( 'menu_item_dropdown_heading', array( 'label' => esc_html__( 'Sub Menu Button', 'jet-menu' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ) ); $this->add_responsive_control( 'menu_item_dropdown_icon_size', array( 'label' => esc_html__( 'Icon Size', 'jet-menu' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'range' => array( 'px' => array( 'min' => 8, 'max' => 100, ), ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-dropdown-arrow i' => 'font-size: {{SIZE}}{{UNIT}}', '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-dropdown-arrow svg' => 'width: {{SIZE}}{{UNIT}}', ), ) ); $this->add_control( 'menu_item_divider_heading', array( 'label' => esc_html__( 'Divider', 'jet-menu' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => array( 'is_item_divider' => 'yes', ), ) ); $this->add_control( 'menu_item_divider_color', array( 'label' => esc_html__( 'Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] => 'border-bottom-color: {{VALUE}}', ), 'condition' => array( 'is_item_divider' => 'yes', ), ) ); $this->add_responsive_control( 'menu_item_divider_width', array( 'label' => esc_html__( 'Width', 'jet-menu' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'range' => array( 'px' => array( 'min' => 1, 'max' => 10, ), ), 'default' => array( 'unit' => 'px', 'size' => 1, ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] => 'border-bottom-style: solid; border-bottom-width: {{SIZE}}{{UNIT}}', ), 'condition' => array( 'is_item_divider' => 'yes', ), ) ); $this->add_control( 'menu_item_state_heading', array( 'label' => esc_html__( 'States', 'jet-menu' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ) ); $this->start_controls_tabs( 'tabs_menu_items_style' ); $this->start_controls_tab( 'tab_menu_items_normal', array( 'label' => esc_html__( 'Normal', 'jet-menu' ), ) ); $this->add_control( 'menu_item_icon_color', array( 'label' => esc_html__( 'Icon Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-menu-icon' => 'color: {{VALUE}}', ), 'condition' => array( 'is_item_icon' => 'yes', ), ) ); $this->add_control( 'item_label_color', array( 'label' => esc_html__( 'Label', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-menu-label' => 'color: {{VALUE}}', ), ) ); $this->add_control( 'item_sub_label_color', array( 'label' => esc_html__( 'Sub Label', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ' .mobile-sub-level-link .jet-menu-label' => 'color: {{VALUE}}', ), 'condition' => array( 'sub-open-layout' => 'dropdown', ), ) ); $this->add_control( 'item_desc_color', array( 'label' => esc_html__( 'Description', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-menu-desc' => 'color: {{VALUE}}', ), 'condition' => array( 'is_item_desc' => 'yes', ), ) ); $this->add_control( 'menu_item_badge_color', array( 'label' => esc_html__( 'Badge Text Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-menu-badge__inner' => 'color: {{VALUE}}', ), 'condition' => array( 'is_item_badge' => 'yes', ), ) ); $this->add_control( 'menu_item_badge_bg_color', array( 'label' => esc_html__( 'Badge Background Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-menu-badge__inner' => 'background-color: {{VALUE}}', ), 'condition' => array( 'is_item_badge' => 'yes', ), ) ); $this->add_control( 'menu_item_dropdown_color', array( 'label' => esc_html__( 'Sub Menu Icon Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ' .jet-dropdown-arrow' => 'color: {{VALUE}}', ), ) ); $this->add_control( 'sub_menu_item_dropdown_color', array( 'label' => esc_html__( 'Sub Menu Dropdown Icon Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ' .mobile-sub-level-link + .jet-dropdown-arrow' => 'color: {{VALUE}}', ), 'condition' => array( 'sub-open-layout' => 'dropdown', ), ) ); $this->add_control( 'menu_item_bg_color', array( 'label' => esc_html__( 'Item Background', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] => 'background-color: {{VALUE}}', ), ) ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_menu_items_hover', array( 'label' => esc_html__( 'Hover', 'jet-menu' ), ) ); $this->add_control( 'menu_item_icon_color_hover', array( 'label' => esc_html__( 'Icon Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ':hover .jet-menu-icon' => 'color: {{VALUE}}', ), 'condition' => array( 'is_item_icon' => 'yes', ), ) ); $this->add_control( 'item_label_color_hover', array( 'label' => esc_html__( 'Label', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ':hover .jet-menu-label' => 'color: {{VALUE}}', ), ) ); $this->add_control( 'item_desc_color_hover', array( 'label' => esc_html__( 'Description', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ':hover .jet-menu-desc' => 'color: {{VALUE}}', ), 'condition' => array( 'is_item_desc' => 'yes', ), ) ); $this->add_control( 'menu_item_badge_color_hover', array( 'label' => esc_html__( 'Badge Text Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ':hover .jet-menu-badge__inner' => 'color: {{VALUE}}', ), 'condition' => array( 'is_item_badge' => 'yes', ), ) ); $this->add_control( 'menu_item_badge_bg_color_hover', array( 'label' => esc_html__( 'Badge Background Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ':hover .jet-menu-badge__inner' => 'background-color: {{VALUE}}', ), 'condition' => array( 'is_item_badge' => 'yes', ), ) ); $this->add_control( 'menu_item_dropdown_color_hover', array( 'label' => esc_html__( 'Sub Menu Icon Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ':hover .jet-dropdown-arrow' => 'color: {{VALUE}}', ), ) ); $this->add_control( 'menu_item_bg_color_hover', array( 'label' => esc_html__( 'Item Background', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . ':hover' => 'background-color: {{VALUE}}', ), ) ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_menu_items_active', array( 'label' => esc_html__( 'Active', 'jet-menu' ), ) ); $this->add_control( 'menu_item_icon_color_active', array( 'label' => esc_html__( 'Icon Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . '.jet-mobile-menu__item--active .jet-menu-icon' => 'color: {{VALUE}}', ), 'condition' => array( 'is_item_icon' => 'yes', ), ) ); $this->add_control( 'item_label_color_active', array( 'label' => esc_html__( 'Label', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . '.jet-mobile-menu__item--active .jet-menu-label' => 'color: {{VALUE}}', ), ) ); $this->add_control( 'item_desc_color_active', array( 'label' => esc_html__( 'Description', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . '.jet-mobile-menu__item--active .jet-menu-desc' => 'color: {{VALUE}}', ), 'condition' => array( 'is_item_desc' => 'yes', ), ) ); $this->add_control( 'menu_item_badge_color_active', array( 'label' => esc_html__( 'Badge Text Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . '.jet-mobile-menu__item--active .jet-menu-badge__inner' => 'color: {{VALUE}}', ), 'condition' => array( 'is_item_badge' => 'yes', ), ) ); $this->add_control( 'menu_item_badge_bg_color_active', array( 'label' => esc_html__( 'Badge Background Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . '.jet-mobile-menu__item--active .jet-menu-badge__inner' => 'background-color: {{VALUE}}', ), 'condition' => array( 'is_item_badge' => 'yes', ), ) ); $this->add_control( 'menu_item_dropdown_color_active', array( 'label' => esc_html__( 'Sub Menu Icon Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . '.jet-mobile-menu__item--active .jet-dropdown-arrow' => 'color: {{VALUE}}', ), ) ); $this->add_control( 'menu_item_bg_color_active', array( 'label' => esc_html__( 'Item Background', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['item'] . '.jet-mobile-menu__item--active' => 'background-color: {{VALUE}}', ), ) ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); $this->start_controls_section( 'section_mobile_menu_advanced_style', array( 'label' => esc_html__( 'Mobile Advanced', 'jet-menu' ), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, ) ); $this->add_control( 'mobile_menu_loader_color', array( 'label' => esc_html__( 'Loader Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'default' => '#3a3a3a', 'render_type' => 'template', ) ); $this->add_control( 'mobile_cover_bg_color', array( 'label' => esc_html__( 'Cover Color', 'jet-menu' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['widget_instance'] . ' .jet-mobile-menu-cover' => 'background-color: {{VALUE}}', ), 'condition' => array( 'layout' => array( 'slide-out' ), ), ) ); $this->end_controls_section(); } /** * Get available menus list * * @return array */ public function get_available_menus() { $raw_menus = wp_get_nav_menus(); $menus = wp_list_pluck( $raw_menus, 'name', 'term_id' ); $parent = isset( $_GET['parent_menu'] ) ? absint( $_GET['parent_menu'] ) : 0; if ( 0 < $parent && isset( $menus[ $parent ] ) ) { unset( $menus[ $parent ] ); } return $menus; } /** * Render the widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @access protected */ protected function render() { $settings = $this->get_settings(); if ( ! isset( $settings['menu'] ) ) { return; } if ( ! $settings['menu'] ) { if ( is_user_logged_in() ) { esc_html_e( 'Please, select menu.', 'jet-menu' ); } return; } else { $menu = $settings['menu']; } $args = array( 'menu' => $settings['menu'], ); $preset = isset( $settings['preset'] ) ? absint( $settings['preset'] ) : 0; if ( 0 !== $preset ) { $preset_options = get_post_meta( $preset, jet_menu()->settings_manager->options_manager->settings_key, true ); jet_menu()->settings_manager->options_manager->pre_set_options( $preset_options ); } else { jet_menu()->settings_manager->options_manager->pre_set_options( false ); } jet_menu()->render_manager->location_manager->add_menu_advanced_styles( $menu ); jet_menu()->render_manager->location_manager->add_dynamic_styles( $preset ); $force_device_mode = \Elementor\Plugin::$instance->editor->is_edit_mode() ? $settings['force-editor-device'] : false; if ( ! $force_device_mode ) { switch ( $settings['device-view'] ) { case 'both': if ( ! \Jet_Menu_Tools::is_phone() ) { $args = array_merge( $args, jet_menu()->render_manager->location_manager->get_mega_nav_args( $preset ) ); wp_nav_menu( $args ); } else { $this->render_mobile_html( $menu ); } break; case 'desktop': $args = array_merge( $args, jet_menu()->render_manager->location_manager->get_mega_nav_args( $preset ) ); wp_nav_menu( $args ); break; case 'mobile': $this->render_mobile_html( $menu ); break; } } else { switch ( $force_device_mode ) { case 'desktop': $args = array_merge( $args, jet_menu()->render_manager->location_manager->get_mega_nav_args( $preset ) ); wp_nav_menu( $args ); break; case 'mobile': $this->render_mobile_html( $menu ); break; } } if ( $this->is_css_required() ) { $dynamic_css = jet_menu()->dynamic_css_manager; add_filter( 'cx_dynamic_css/collector/localize_object', array( $this, 'fix_preview_css' ) ); $dynamic_css->collector->print_style(); remove_filter( 'cx_dynamic_css/collector/localize_object', array( $this, 'fix_preview_css' ) ); } } /** * [render_mobile_html description] * @param [type] $menu [description] * @return [type] [description] */ public function render_mobile_html( $menu ) { $settings = $this->get_settings(); $menu_uniqid = uniqid(); $mobile_menu_id = isset( $settings['mobile_menu'] ) && \Jet_Menu_Tools::is_phone() ? $settings['mobile_menu'] : false; $render_widget_instance = new \Jet_Menu\Render\Mobile_Menu_Render( array( 'menu-id' => $settings[ 'menu' ], 'mobile-menu-id' => $mobile_menu_id, 'layout' => $settings[ 'layout' ], 'toggle-position' => $settings[ 'toggle-position' ], 'container-position' => $settings[ 'container-position' ], 'item-header-template' => $settings[ 'item_header_template' ], 'item-before-template' => $settings[ 'item_before_template' ], 'item-after-template' => $settings[ 'item_after_template' ], 'use-breadcrumbs' => filter_var( $settings[ 'use_breadcrumbs' ], FILTER_VALIDATE_BOOLEAN ), 'breadcrumbs-path' => $settings[ 'breadcrumbs_path' ], 'toggle-text' => $settings[ 'toggle_text' ], 'toggle-loader' => filter_var( $settings[ 'toggle_loader' ], FILTER_VALIDATE_BOOLEAN ), 'back-text' => $settings[ 'back_text' ], 'is-item-icon' => filter_var( $settings[ 'is_item_icon' ], FILTER_VALIDATE_BOOLEAN ), 'is-item-badge' => filter_var( $settings[ 'is_item_badge' ], FILTER_VALIDATE_BOOLEAN ), 'is-item-desc' => filter_var( $settings[ 'is_item_desc' ], FILTER_VALIDATE_BOOLEAN ), 'loader-color' => $settings[ 'mobile_menu_loader_color' ], 'sub-menu-trigger' => $settings[ 'sub-menu-trigger' ], 'sub-open-layout' => $settings[ 'sub-open-layout' ], 'close-after-navigate' => filter_var( $settings[ 'close-after-navigate' ], FILTER_VALIDATE_BOOLEAN ), 'toggle-closed-icon-html' => $this->get_icon_html( $settings[ 'toggle_closed_state_icon' ] ), 'toggle-opened-icon-html' => $this->get_icon_html( $settings[ 'toggle_opened_state_icon' ] ), 'close-icon-html' => $this->get_icon_html( $settings[ 'container_close_icon' ] ), 'back-icon-html' => $this->get_icon_html( $settings[ 'container_back_icon' ] ), 'dropdown-icon-html' => $this->get_icon_html( $settings[ 'dropdown_icon' ] ), 'dropdown-opened-icon-html' => $this->get_icon_html( $settings[ 'dropdown_opened_icon' ] ), 'breadcrumb-icon-html' => $this->get_icon_html( $settings[ 'breadcrumb_icon' ] ), ) ); //ob_start(); $render_widget_instance->render(); // echo ob_get_clean(); } /** * [get_icon_html description] * @param boolean $icon_setting [description] * @return [type] [description] */ public function get_icon_html( $icon_setting = false, $attr = array() ) { if ( ! $icon_setting ) { return false; } ob_start(); Icons_Manager::render_icon( $icon_setting, $attr ); return ob_get_clean(); } /** * Check if need to insert custom CSS * @return boolean [description] */ public function is_css_required() { $allowed_actions = array( 'elementor_render_widget', 'elementor' ); if ( isset( $_REQUEST['action'] ) && in_array( $_REQUEST['action'], $allowed_actions ) ) { return true; } return false; } /** * Fix preview styles * * @return array */ public function fix_preview_css( $data ) { if ( ! empty( $data['css'] ) ) { printf( '', html_entity_decode( $data['css'] ) ); } return $data; } }