jet-accordion-widget.php 0000755 00000107216 15111615464 0011275 0 ustar 00 '.jet-accordion',
'toggle' => '.jet-accordion > .jet-accordion__inner > .jet-toggle',
'control' => '.jet-accordion > .jet-accordion__inner > .jet-toggle > .jet-toggle__control',
'active_control' => '.jet-accordion > .jet-accordion__inner > .jet-toggle.active-toggle > .jet-toggle__control',
'content' => '.jet-accordion > .jet-accordion__inner > .jet-toggle > .jet-toggle__content',
'label' => '.jet-toggle__label-text',
'icon' => '.jet-toggle__label-icon',
)
);
$this->start_controls_section(
'section_items_data',
array(
'label' => esc_html__( 'Items', 'jet-tabs' ),
)
);
do_action( 'jet-engine-query-gateway/control', $this, 'toggles' );
$repeater = new Repeater();
$repeater->add_control(
'item_active',
array(
'label' => esc_html__( 'Active', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Yes', 'jet-tabs' ),
'label_off' => esc_html__( 'No', 'jet-tabs' ),
'return_value' => 'yes',
'default' => 'false',
)
);
$repeater->add_control(
$this->__new_icon_prefix . 'item_icon',
array(
'label' => esc_html__( 'Icon', 'jet-tabs' ),
'type' => Controls_Manager::ICONS,
'label_block' => false,
'skin' => 'inline',
'fa4compatibility' => 'item_icon',
'default' => array(
'value' => 'fas fa-plus',
'library' => 'fa-solid',
),
)
);
$repeater->add_control(
$this->__new_icon_prefix . 'item_active_icon',
array(
'label' => esc_html__( 'Active Icon', 'jet-tabs' ),
'type' => Controls_Manager::ICONS,
'label_block' => false,
'skin' => 'inline',
'fa4compatibility' => 'item_active_icon',
'default' => array(
'value' => 'fas fa-minus',
'library' => 'fa-solid',
),
)
);
$repeater->add_control(
'item_label',
array(
'label' => esc_html__( 'Label', 'jet-tabs' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'New Tab', 'jet-tabs' ),
'dynamic' => array(
'active' => true,
),
)
);
$repeater->add_control(
'content_type',
array(
'label' => esc_html__( 'Content Type', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'default' => 'template',
'options' => array(
'template' => esc_html__( 'Template', 'jet-tabs' ),
'editor' => esc_html__( 'Editor', 'jet-tabs' ),
),
'label_block' => 'true',
)
);
$repeater->add_control(
'item_template_id',
array(
'label' => esc_html__( 'Choose Template', 'jet-tabs' ),
'type' => 'jet-query',
'query_type' => 'elementor_templates',
'edit_button' => array(
'active' => true,
'label' => esc_html__( 'Edit Template', 'jet-tabs' ),
),
'condition' => array(
'content_type' => 'template',
)
)
);
$repeater->add_control(
'item_editor_content',
array(
'label' => esc_html__( 'Content', 'jet-tabs' ),
'type' => Controls_Manager::WYSIWYG,
'default' => esc_html__( 'Tab Item Content', 'jet-tabs' ),
'dynamic' => array(
'active' => true,
),
'condition' => array(
'content_type' => 'editor',
)
)
);
$repeater->add_control(
'control_id',
array(
'label' => esc_html__( 'Control CSS ID', 'jet-tabs' ),
'type' => Controls_Manager::TEXT,
'dynamic' => array(
'active' => true,
),
)
);
$repeater->add_control(
'item_custom_css_class',
array(
'label' => esc_html__( 'Item Custom CSS Class', 'jet-tabs' ),
'type' => Controls_Manager::TEXT,
'dynamic' => array(
'active' => true,
),
)
);
$this->add_control(
'toggles',
array(
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'default' => array(
array(
'item_label' => esc_html__( 'Toggle #1', 'jet-tabs' ),
),
array(
'item_label' => esc_html__( 'Toggle #2', 'jet-tabs' ),
),
array(
'item_label' => esc_html__( 'Toggle #3', 'jet-tabs' ),
),
),
'title_field' => '{{{ item_label }}}',
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_settings_data',
array(
'label' => esc_html__( 'Settings', 'jet-tabs' ),
)
);
$this->add_control(
'item_html_tag',
array(
'label' => esc_html__( 'HTML Tag', 'jet-tabs' ),
'description' => esc_html__( 'Select the HTML Tag for the Item\'s label', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'options' => $this->get_available_item_html_tags(),
'default' => 'div',
)
);
$this->add_control(
'collapsible',
array(
'label' => esc_html__( 'Collapsible', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Yes', 'jet-tabs' ),
'label_off' => esc_html__( 'No', 'jet-tabs' ),
'return_value' => 'yes',
'default' => 'false',
)
);
$this->add_control(
'show_effect',
array(
'label' => esc_html__( 'Show Effect', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'default' => 'move-up',
'options' => array(
'none' => esc_html__( 'None', 'jet-tabs' ),
'fade' => esc_html__( 'Fade', 'jet-tabs' ),
'zoom-in' => esc_html__( 'Zoom In', 'jet-tabs' ),
'zoom-out' => esc_html__( 'Zoom Out', 'jet-tabs' ),
'move-up' => esc_html__( 'Move Up', 'jet-tabs' ),
'fall-perspective' => esc_html__( 'Fall Perspective', 'jet-tabs' ),
),
)
);
$this->add_control(
'ajax_template',
array(
'label' => esc_html__( 'Use Ajax Loading for Template', 'jet-tabs' ),
'description' => esc_html__( 'Note: Do not use with query or dynamic data', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'jet-tabs' ),
'label_off' => esc_html__( 'Off', 'jet-tabs' ),
'return_value' => 'yes',
'default' => 'false',
)
);
$this->add_control(
'faq_schema',
array(
'label' => esc_html__( 'FAQ Schema', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'separator' => 'before',
)
);
$this->add_control(
'content_scrolling',
array(
'label' => esc_html__( 'Scrolling to the Content', 'jet-tabs' ),
'description' => esc_html__( 'Scrolling to the Content after Switching Tab Control', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'jet-tabs' ),
'label_off' => esc_html__( 'Off', 'jet-tabs' ),
'return_value' => 'yes',
'default' => 'false',
)
);
$this->add_control(
'content_scrolling_offset',
array(
'label' => esc_html__( 'Scrolling offset (px)', 'jet-tabs' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 0,
'max' => 100,
),
),
'default' => array(
'unit' => 'px',
'size' => 0,
),
'condition' => array(
'content_scrolling' => 'yes'
)
)
);
$this->add_control(
'content_scrolling_delay',
array(
'label' => esc_html__( 'Scroll animation speed (ms)', 'jet-tabs' ),
'type' => Controls_Manager::NUMBER,
'default' => 500,
'min' => 100,
'max' => 10000,
'step' => 10,
'condition' => array(
'content_scrolling' => 'yes'
),
)
);
$this->end_controls_section();
$this->__start_controls_section(
'section_accordion_container_style',
array(
'label' => esc_html__( 'Accordion Container', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'instance_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['instance'],
),
25
);
$this->__add_responsive_control(
'instance_padding',
array(
'label' => esc_html__( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['instance'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'instance_border',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['instance'],
),
25
);
$this->__add_control(
'instance_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['instance'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'instance_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['instance'],
),
100
);
$this->__end_controls_section();
/**
* Toggle Style Section
*/
$this->__start_controls_section(
'section_toggle_style',
array(
'label' => esc_html__( 'Toggle', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'toggle_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'],
),
25
);
$this->__add_responsive_control(
'toggle_padding',
array(
'label' => esc_html__( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['toggle'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__add_responsive_control(
'toggle_margin',
array(
'label' => esc_html__( 'Margin', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['toggle'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'toggle_border',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'],
),
25
);
$this->__add_control(
'toggle_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['toggle'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'toggle_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'],
),
100
);
$this->__end_controls_section();
/**
* Toggle Control Style Section
*/
$this->__start_controls_section(
'section_toggle_control_style',
array(
'label' => esc_html__( 'Toggle Control', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_control(
'toggle_icon_heading',
array(
'label' => esc_html__( 'Icon ', 'jet-tabs' ),
'type' => Controls_Manager::HEADING,
),
25
);
$this->__add_control(
'toggle_icon_position',
array(
'label' => esc_html__( 'Position', 'jet-tabs' ),
'type' => Controls_Manager::CHOOSE,
'options' => array(
'left' => array(
'title' => esc_html__( 'Left', 'jet-tabs' ),
'icon' => 'eicon-h-align-left',
),
'right' => array(
'title' => esc_html__( 'Right', 'jet-tabs' ),
'icon' => 'eicon-h-align-right',
),
),
'default' => 'left',
'label_block' => false,
'classes' => 'jet-tabs-text-align-control',
),
25
);
$this->__add_responsive_control(
'toggle_icon_margin',
array(
'label' => esc_html__( 'Margin', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ' ' . $css_scheme['icon'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__add_responsive_control(
'toggle_label_aligment',
array(
'label' => esc_html__( 'Alignment', 'jet-tabs' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'flex-start',
'options' => array(
'flex-start' => array(
'title' => esc_html__( 'Start', 'jet-tabs' ),
'icon' => ! is_rtl() ? 'fa fa-arrow-left' : 'fa fa-arrow-right',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-tabs' ),
'icon' => 'fa fa-align-center',
),
'space-between' => array(
'title' => esc_html__( 'Justify', 'jet-tabs' ),
'icon' => 'fa fa-align-justify',
),
'flex-end' => array(
'title' => esc_html__( 'End', 'jet-tabs' ),
'icon' => ! is_rtl() ? 'fa fa-arrow-right' : 'fa fa-arrow-left',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] => 'justify-content: {{VALUE}};',
),
'separator' => 'before',
),
25
);
$this->__add_responsive_control(
'toggle_label_text_aligment',
array(
'label' => esc_html__( 'Text Alignment', 'jet-tabs' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'left',
'options' => array(
'left' => array(
'title' => esc_html__( 'Left', 'jet-tabs' ),
'icon' => 'eicon-text-align-left',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-tabs' ),
'icon' => 'eicon-text-align-center',
),
'right' => array(
'title' => esc_html__( 'Right', 'jet-tabs' ),
'icon' => 'eicon-text-align-right',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['label'] => 'text-align: {{VALUE}};',
),
),
25
);
$this->__start_controls_tabs( 'toggle_general_styles' );
$this->__start_controls_tab(
'toggle_control_normal',
array(
'label' => esc_html__( 'Normal', 'jet-tabs' ),
)
);
$this->__add_control(
'toggle_label_color',
array(
'label' => esc_html__( 'Text Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'global' => array(
'default' => Global_Colors::COLOR_TEXT,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ' ' . $css_scheme['label'] => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'toggle_label_typography',
'selector' => '{{WRAPPER}} '. $css_scheme['control'] . ' ' . $css_scheme['label'],
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
),
),
50
);
$this->__add_group_control(
\Jet_Tabs_Group_Control_Box_Style::get_type(),
array(
'label' => esc_html__( 'Icon', 'jet-tabs' ),
'name' => 'toggle_icon_box',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . ' ' . $css_scheme['icon'] . ' .icon-normal',
),
25
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'toggle_control_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'],
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'toggle_control_border',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'],
),
25
);
$this->__end_controls_tab();
$this->__start_controls_tab(
'toggle_control_hover',
array(
'label' => esc_html__( 'Hover', 'jet-tabs' ),
)
);
$this->__add_control(
'toggle_label_color_hover',
array(
'label' => esc_html__( 'Text Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'global' => array(
'default' => Global_Colors::COLOR_TEXT,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ':hover ' . $css_scheme['label'] => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'toggle_label_typography_hover',
'selector' => '{{WRAPPER}} '. $css_scheme['control'] . ':hover ' . $css_scheme['label'],
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
),
),
50
);
$this->__add_group_control(
\Jet_Tabs_Group_Control_Box_Style::get_type(),
array(
'label' => esc_html__( 'Icon', 'jet-tabs' ),
'name' => 'toggle_icon_box_hover',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . ':hover ' . $css_scheme['icon'] . ' .icon-normal',
),
25
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'toggle_control_background_hover',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . ':hover',
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'toggle_control_border_hover',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . ':hover',
),
25
);
$this->__end_controls_tab();
$this->__start_controls_tab(
'toggle_control_active',
array(
'label' => esc_html__( 'Active', 'jet-tabs' ),
)
);
$this->__add_control(
'toggle_label_color_active',
array(
'label' => esc_html__( 'Text Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'global' => array(
'default' => Global_Colors::COLOR_TEXT,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['active_control'] . ' ' . $css_scheme['label'] => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'toggle_label_typography_active',
'selector' => '{{WRAPPER}} '. $css_scheme['active_control'] . ' ' . $css_scheme['label'],
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
),
),
50
);
$this->__add_group_control(
\Jet_Tabs_Group_Control_Box_Style::get_type(),
array(
'label' => esc_html__( 'Icon', 'jet-tabs' ),
'name' => 'toggle_icon_box_active',
'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'] . '.active-toggle ' . $css_scheme['icon'] . ' .icon-active',
),
25
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'toggle_control_background_active',
'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'] . '.active-toggle > .jet-toggle__control',
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'toggle_control_border_active',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'] . '.active-toggle > .jet-toggle__control',
),
25
);
$this->__end_controls_tab();
$this->__end_controls_tabs();
$this->__add_responsive_control(
'toggle_control_padding',
array(
'label' => esc_html__( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'separator' => 'before',
'custom_units' => true,
),
50
);
$this->__add_control(
'toggle_control_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'toggle_control_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'],
),
100
);
$this->__end_controls_section();
/**
* Toggle Content Style Section
*/
$this->__start_controls_section(
'section_tabs_content_style',
array(
'label' => esc_html__( 'Toggle Content', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'tabs_content_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['content'],
),
50
);
$this->__add_control(
'tabs_content_text_color',
array(
'label' => esc_html__( 'Text color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content'] => 'color: {{VALUE}};',
),
),
25
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'tabs_content_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['content'],
),
25
);
$this->__add_responsive_control(
'tabs_content_padding',
array(
'label' => esc_html__( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content'] . ' > .jet-toggle__content-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__add_responsive_control(
'tabs_content_margin',
array(
'label' => esc_html__( 'Margin', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'tabs_content_border',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['content'],
),
25
);
$this->__add_responsive_control(
'tabs_content_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'tabs_content_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['content'],
),
100
);
$this->__add_control(
'tabs_content_loader_style_heading',
array(
'label' => esc_html__( 'Loader Styles', 'jet-tabs' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => array(
'ajax_template' => 'yes',
),
),
25
);
$this->__add_control(
'tabs_content_loader_color',
array(
'label' => esc_html__( 'Loader color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content'] . ' .jet-tabs-loader' => 'border-color: {{VALUE}}; border-top-color: white;',
),
'condition' => array(
'ajax_template' => 'yes',
),
),
25
);
$this->__end_controls_section();
}
/**
* [render description]
* @return [type] [description]
*/
protected function render() {
$this->__context = 'render';
$toggles = $this->get_settings_for_display( 'toggles' );
$toggles = apply_filters( 'jet-tabs/widget/loop-items', $toggles, 'toggles', $this );
$faq_schema = $this->get_settings_for_display( 'faq_schema' );
$id_int = substr( $this->get_id_int(), 0, 3 );
$show_effect = $this->get_settings( 'show_effect' );
$ajax_template = filter_var( $this->get_settings( 'ajax_template' ), FILTER_VALIDATE_BOOLEAN );
$settings = array(
'collapsible' => filter_var( $this->get_settings( 'collapsible' ), FILTER_VALIDATE_BOOLEAN ),
'ajaxTemplate' => $ajax_template,
'switchScrolling' => filter_var( $this->get_settings( 'content_scrolling' ), FILTER_VALIDATE_BOOLEAN ),
'switchScrollingOffset' => !empty( $this->get_settings_for_display( 'content_scrolling_offset' ) ) ? $this->get_settings_for_display( 'content_scrolling_offset' ) : 0,
'switchScrollingDelay' => !empty( $this->get_settings_for_display( 'content_scrolling_delay' ) ) ? $this->get_settings_for_display( 'content_scrolling_delay' ) : 500
);
$this->add_render_attribute( 'instance', array(
'class' => array(
'jet-accordion',
),
'data-settings' => json_encode( $settings ),
) );
$toggle_icon_position = $this->get_settings( 'toggle_icon_position' );
$toggle_item_label_tag = ! empty( $this->get_settings( 'item_html_tag' ) ) ? $this->get_settings( 'item_html_tag' ) : 'div';
$toggle_item_label_tag = $this->validate_html_tag( $toggle_item_label_tag );
?>
get_render_attribute_string( 'instance' ); ?>>
$item ) {
do_action( 'jet-engine-query-gateway/do-item', $item );
$toggle_count = $index + 1;
$toggle_setting_key = $this->get_repeater_setting_key( 'jet_toggle', 'toggles', $index );
$toggle_control_setting_key = $this->get_repeater_setting_key( 'jet_toggle_control', 'toggles', $index );
$toggle_content_setting_key = $this->get_repeater_setting_key( 'jet_toggle_content', 'toggles', $index );
$is_item_active = filter_var( $item['item_active'], FILTER_VALIDATE_BOOLEAN );
$toggle_control_id = ! empty( $item['control_id'] ) ? esc_attr( $item['control_id'] ) : 'jet-toggle-control-' . $id_int . $toggle_count;
$this->add_render_attribute( $toggle_control_setting_key, array(
'id' => $toggle_control_id,
'class' => array(
'jet-toggle__control',
'elementor-menu-anchor',
),
'data-toggle' => $toggle_count,
'role' => 'button',
'tabindex' => 0,
'aria-controls' => 'jet-toggle-content-' . $id_int . $toggle_count,
'aria-expanded' => $is_item_active ? 'true' : 'false',
'data-template-id' => ! empty( $item['item_template_id'] ) ? $item['item_template_id'] : 'false',
) );
$toggle_control_icon_html = '';
$normal_icon_html = $this->__get_icon( 'item_icon', $item, '
%s' );
$active_icon_html = $this->__get_icon( 'item_active_icon', $item, '
%s' );
if ( ! empty( $normal_icon_html ) && ! empty( $active_icon_html ) ) {
$toggle_control_icon_html .= sprintf( '
%1$s%2$s
', $normal_icon_html, $active_icon_html, $toggle_icon_position );
}
$toggle_control_label_html = '';
if ( ! empty( $item['item_label'] ) ) {
$toggle_control_label_html = sprintf(
'<%1$s class="jet-toggle__label-text">%2$s%1$s>',
esc_attr( $toggle_item_label_tag ),
$item['item_label']
);
}
$this->add_render_attribute( $toggle_content_setting_key, array(
'id' => 'jet-toggle-content-' . $id_int . $toggle_count,
'class' => array(
'jet-toggle__content'
),
'data-toggle' => $toggle_count,
'role' => 'region',
'data-template-id' => ! empty( $item['item_template_id'] ) ? $item['item_template_id'] : 'false',
) );
$content_html = '';
switch ( $item[ 'content_type' ] ) {
case 'template':
if ( ! empty( $item['item_template_id'] ) ) {
// for multi-language plugins
$template_id = apply_filters( 'jet-tabs/widgets/template_id', $item['item_template_id'], $this );
$template_content = jet_tabs()->elementor()->frontend->get_builder_content( $template_id );
if ( ! empty( $template_content ) ) {
if ( ! $ajax_template ) {
$content_html .= $template_content;
} else {
$content_html .= '
';
}
if ( jet_tabs_integration()->is_edit_mode() ) {
$link = add_query_arg(
array(
'elementor' => '',
'jet-tabs-canvas' => '',
),
get_permalink( $item['item_template_id'] )
);
$content_html .= sprintf( '
%s
', $link, esc_html__( 'Edit Template', 'jet-tabs' ) );
}
} else {
$content_html = $this->no_template_content_message();
}
} else {
$content_html = $this->no_templates_message();
}
break;
case 'editor':
$content_html = $this->parse_text_editor( $item['item_editor_content'] );
break;
}
$item_custom_css_class = ! empty( $item['item_custom_css_class'] ) ? esc_attr( $item['item_custom_css_class'] ) : '';
$this->add_render_attribute( $toggle_setting_key, array(
'class' => array(
$item_custom_css_class,
'jet-accordion__item',
'jet-toggle',
'jet-toggle-' . $show_effect . '-effect',
$is_item_active ? 'active-toggle' : '',
),
) );
?>
get_render_attribute_string( $toggle_setting_key ); // phpcs:ignore ?>>
get_render_attribute_string( $toggle_control_setting_key ); // phpcs:ignore ?>>
get_render_attribute_string( $toggle_content_setting_key ); // phpcs:ignore ?>>
add_item( $item['item_label'], $content_html );
}
}
do_action( 'jet-engine-query-gateway/reset-item' );
?>
' . esc_html__( 'You Haven’t Saved Templates Yet.', 'jet-tabs' ) . '
';
}
/**
* [no_templates_message description]
* @return [type] [description]
*/
public function no_templates_message() {
$message = '' . esc_html__( 'Template is not defined. ', 'jet-tabs' ) . '';
$link = add_query_arg(
array(
'post_type' => 'elementor_library',
'action' => 'elementor_new_post',
'_wpnonce' => wp_create_nonce( 'elementor_action_new_post' ),
'template_type' => 'section',
),
esc_url( admin_url( '/edit.php' ) )
);
$new_link = '' . esc_html__( 'Select an existing template or create a ', 'jet-tabs' ) . '' . esc_html__( 'new one', 'jet-tabs' ) . '' ;
return sprintf(
'%1$s%2$s
',
$message,
jet_tabs_integration()->in_elementor() ? $new_link : ''
);
}
/**
* [no_template_content_message description]
* @return [type] [description]
*/
public function no_template_content_message() {
$message = '' . esc_html__( 'The toggles are working. Please, note, that you have to add a template to the library in order to be able to display it inside the toggles.', 'jet-tabs' ) . '';
return sprintf( '%1$s
', $message );
}
/**
* [get_template_edit_link description]
* @param [type] $template_id [description]
* @return [type] [description]
*/
public function get_template_edit_link( $template_id ) {
$link = add_query_arg( 'elementor', '', get_permalink( $template_id ) );
return ' ' . esc_html__( 'Edit Template', 'jet-tabs' ) . '';
}
}
jet-image-accordion-widget.php 0000755 00000103776 15111615464 0012364 0 ustar 00 '.jet-image-accordion',
'list' => '.jet-image-accordion__list',
'item' => '.jet-image-accordion__item',
'item_inner' => '.jet-image-accordion__inner',
'image' => '.jet-image-accordion__image-instance',
'content_container' => '.jet-image-accordion__content',
'title_default' => '.jet-image-accordion__title-default',
'title' => '.jet-image-accordion__title',
'desc' => '.jet-image-accordion__desc',
'button_container' => '.jet-image-accordion__button-container',
'button' => '.jet-image-accordion__button',
)
);
$this->start_controls_section(
'section_items_data',
array(
'label' => esc_html__( 'Items', 'jet-tabs' ),
)
);
do_action( 'jet-engine-query-gateway/control', $this, 'item_list' );
$repeater = new Repeater();
$repeater->add_control(
'item_active',
array(
'label' => esc_html__( 'Active', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Yes', 'jet-tabs' ),
'label_off' => esc_html__( 'No', 'jet-tabs' ),
'return_value' => 'yes',
'default' => 'false',
)
);
$repeater->add_control(
'item_image',
array(
'label' => esc_html__( 'Image', 'jet-tabs' ),
'type' => Controls_Manager::MEDIA,
'dynamic' => array( 'active' => true ),
'default' => array(
'url' => Utils::get_placeholder_image_src(),
),
)
);
$repeater->add_control(
'item_title',
array(
'label' => esc_html__( 'Title', 'jet-tabs' ),
'type' => Controls_Manager::TEXT,
'dynamic' => array( 'active' => true ),
)
);
$repeater->add_control(
'item_desc',
array(
'label' => esc_html__( 'Description', 'jet-tabs' ),
'type' => Controls_Manager::TEXTAREA,
'dynamic' => array( 'active' => true ),
)
);
$repeater->add_control(
'item_link_text',
array(
'label' => esc_html__( 'Button text', 'jet-tabs' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'More', 'jet-tabs' ),
'dynamic' => array( 'active' => true ),
)
);
$repeater->add_control(
'item_link',
array(
'label' => esc_html__( 'Link', 'jet-tabs' ),
'type' => Controls_Manager::URL,
'placeholder' => 'http://your-link.com',
'dynamic' => array( 'active' => true ),
'default' => array(
'url' => '#',
),
)
);
$this->add_control(
'item_list',
array(
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'default' => array(
array(
'item_image' => array(
'url' => Utils::get_placeholder_image_src(),
),
'item_title' => esc_html__( 'Item #1', 'jet-tabs' ),
'item_desc' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'jet-tabs' ),
),
array(
'item_image' => array(
'url' => Utils::get_placeholder_image_src(),
),
'item_title' => esc_html__( 'Item #2', 'jet-tabs' ),
'item_desc' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'jet-tabs' ),
),
array(
'item_image' => array(
'url' => Utils::get_placeholder_image_src(),
),
'item_title' => esc_html__( 'Item #3', 'jet-tabs' ),
'item_desc' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'jet-tabs' ),
),
),
'title_field' => '{{{ item_title }}}',
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_settings',
array(
'label' => esc_html__( 'Settings', 'jet-tabs' ),
)
);
$this->add_control(
'title_display',
array(
'label' => esc_html__( 'Title Display', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'on_hover' => esc_html__( 'On hover', 'jet-tabs' ),
'on_default_state' => esc_html__( 'On default state', 'jet-tabs' ),
'on_both_states' => esc_html__( 'On default state & on hover', 'jet-tabs' ),
),
'default' => 'on_hover',
)
);
$this->add_control(
'item_html_tag',
array(
'label' => esc_html__( 'Title HTML Tag', 'jet-tabs' ),
'description' => esc_html__( 'Select the HTML Tag for the Item\'s title', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'options' => $this->get_available_item_html_tags(),
'default' => 'h5',
)
);
$this->add_control(
'img_size',
array(
'type' => 'select',
'label' => esc_html__( 'Images Size', 'jet-tabs' ),
'default' => 'full',
'options' => $this->get_image_sizes(),
)
);
$this->add_responsive_control(
'instance_orientation',
array(
'label' => esc_html__( 'Orientation', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'default' => 'vertical',
'options' => array(
'vertical' => esc_html__( 'Vertical', 'jet-tabs' ),
'horizontal' => esc_html__( 'Horizontal', 'jet-tabs' ),
),
'selectors_dictionary' => array(
'vertical' => 'flex-direction: row',
'horizontal' => 'flex-direction: column',
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['list'] => '{{VALUE}}'
),
)
);
$this->add_control(
'active_size',
array(
'label' => esc_html__( 'Active Size(%)', 'jet-tabs' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'%' => array(
'min' => 50,
'max' => 100,
),
),
'default' => array(
'unit' => '%',
'size' => 50,
),
)
);
$this->add_control(
'anim_duration',
array(
'label' => esc_html__( 'Animation Duration', 'jet-tabs' ),
'type' => Controls_Manager::NUMBER,
'default' => 500,
'min' => 100,
'max' => 3000,
'step' => 100,
)
);
$this->add_control(
'anim_ease',
array(
'label' => esc_html__( 'Easing', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'default' => 'circ',
'options' => array(
'sine' => esc_html__( 'Sine', 'jet-tabs' ),
'quint' => esc_html__( 'Quint', 'jet-tabs' ),
'cubic' => esc_html__( 'Cubic', 'jet-tabs' ),
'expo' => esc_html__( 'Expo', 'jet-tabs' ),
'circ' => esc_html__( 'Circ', 'jet-tabs' ),
'back' => esc_html__( 'Back', 'jet-tabs' ),
),
)
);
$this->end_controls_section();
$this->__start_controls_section(
'section_container_style',
array(
'label' => esc_html__( 'Container', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_responsive_control(
'instance_height',
array(
'label' => esc_html__( 'Height(px)', 'jet-tabs' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 100,
'max' => 1000,
),
),
'default' => array(
'unit' => 'px',
'size' => 600,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['list'] => 'height: {{SIZE}}{{UNIT}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'instance_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['instance'],
),
100
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'instance_border',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['instance'],
),
50
);
$this->__add_control(
'instance_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['instance'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'instance_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['instance'],
),
100
);
$this->__end_controls_section();
$this->__start_controls_section(
'section_item_style',
array(
'label' => esc_html__( 'Item', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_responsive_control(
'item_gutter',
array(
'label' => esc_html__( 'Item Gutter', 'jet-tabs' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 0,
'max' => 50,
),
),
'default' => array(
'unit' => 'px',
'size' => 4,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['item'] => 'margin: calc({{SIZE}}{{UNIT}} / 2);',
'{{WRAPPER}} ' . $css_scheme['list'] => 'margin: calc(-{{SIZE}}{{UNIT}} / 2);',
),
),
25
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'item_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['item'],
),
100
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'item_border',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['item'],
),
50
);
$this->__add_control(
'item_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['item'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'item_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['item'],
),
100
);
$this->__add_control(
'item_cover_style_heading',
array(
'label' => esc_html__( 'Cover Styles', 'jet-tabs' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
),
50
);
$this->__start_controls_tabs( 'item_cover_tabs_styles', 50 );
$this->__start_controls_tab(
'item_cover_normal',
array(
'label' => esc_html__( 'Normal', 'jet-tabs' ),
),
50
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'item_cover_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['item'] . ':before',
),
25
);
$this->__end_controls_tab( 50 );
$this->__start_controls_tab(
'item_cover_active',
array(
'label' => esc_html__( 'Active', 'jet-tabs' ),
),
50
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'item_cover_background_active',
'selector' => '{{WRAPPER}} ' . $css_scheme['item'] . '.active-accordion:before',
),
50
);
$this->__end_controls_tab( 50 );
$this->__end_controls_tabs( 50 );
$this->__end_controls_section();
/**
* Content Style Section
*/
$this->__start_controls_section(
'section_content_style',
array(
'label' => esc_html__( 'Content', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_responsive_control(
'items_alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-tabs' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'center',
'options' => array(
'flex-start' => array(
'title' => esc_html__( 'Top', 'jet-tabs' ),
'icon' => 'eicon-v-align-top',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-tabs' ),
'icon' => 'eicon-v-align-middle',
),
'flex-end' => array(
'title' => esc_html__( 'Bottom', 'jet-tabs' ),
'icon' => 'eicon-v-align-bottom',
),
),
'selectors' => array(
'{{WRAPPER}} '. $css_scheme['content_container'] => 'justify-content: {{VALUE}};',
),
),
25
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'item_content_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['content_container'],
),
50
);
$this->__add_responsive_control(
'item_content_padding',
array(
'label' => __( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content_container'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__end_controls_section();
/**
* Title Default Style Section
*/
$this->__start_controls_section(
'section_title_default_style',
array(
'label' => esc_html__( 'Title (Default)', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_responsive_control(
'title_default_horizontal_alignment',
array(
'label' => esc_html__( 'Horizontal Alignment', 'jet-tabs' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'center',
'options' => array(
'left' => array(
'title' => esc_html__( 'Left', 'jet-tabs' ),
'icon' => 'eicon-h-align-left',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-tabs' ),
'icon' => 'eicon-h-align-center',
),
'right' => array(
'title' => esc_html__( 'Right', 'jet-tabs' ),
'icon' => 'eicon-h-align-right',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title_default'] => 'justify-content: {{VALUE}};',
),
),
25
);
$this->__add_responsive_control(
'title_default_vertical_alignment',
array(
'label' => esc_html__( 'Vertical Alignment', 'jet-tabs' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'flex-start',
'options' => array(
'flex-start' => array(
'title' => esc_html__( 'Top', 'jet-tabs' ),
'icon' => 'eicon-v-align-top',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-tabs' ),
'icon' => 'eicon-v-align-middle',
),
'flex-end' => array(
'title' => esc_html__( 'Bottom', 'jet-tabs' ),
'icon' => 'eicon-v-align-bottom',
),
),
'selectors' => array(
'{{WRAPPER}} '. $css_scheme['title_default'] => 'align-self: {{VALUE}};',
),
),
25
);
$this->__add_control(
'title_default_color',
array(
'label' => esc_html__( 'Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title_default'] => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'title_default_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['title_default'] ,
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_TEXT,
),
),
50
);
$this->__add_responsive_control(
'title_default_padding',
array(
'label' => esc_html__( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title_default'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
100
);
$this->__add_responsive_control(
'title_default_margin',
array(
'label' => esc_html__( 'Margin', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title_default'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__end_controls_section();
/**
* Title Style Section
*/
$this->__start_controls_section(
'section_title_style',
array(
'label' => esc_html__( 'Title', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_responsive_control(
'title_alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-tabs' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'left',
'options' => array(
'left' => array(
'title' => esc_html__( 'Left', 'jet-tabs' ),
'icon' => 'eicon-h-align-left',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-tabs' ),
'icon' => 'eicon-h-align-center',
),
'right' => array(
'title' => esc_html__( 'Right', 'jet-tabs' ),
'icon' => 'eicon-h-align-right',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'text-align: {{VALUE}};',
),
'classes' => 'jet-elements-text-align-control',
),
25
);
$this->__add_control(
'title_color',
array(
'label' => esc_html__( 'Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'title_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['title'],
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_TEXT,
),
),
50
);
$this->__add_responsive_control(
'title_padding',
array(
'label' => __( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
100
);
$this->__add_responsive_control(
'title_margin',
array(
'label' => __( 'Margin', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__end_controls_section();
/**
* Description Style Section
*/
$this->__start_controls_section(
'section_desc_style',
array(
'label' => esc_html__( 'Description', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_responsive_control(
'desc_alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-tabs' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'left',
'options' => array(
'left' => array(
'title' => esc_html__( 'Left', 'jet-tabs' ),
'icon' => 'eicon-h-align-left',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-tabs' ),
'icon' => 'eicon-h-align-center',
),
'right' => array(
'title' => esc_html__( 'Right', 'jet-tabs' ),
'icon' => 'eicon-h-align-right',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['desc'] => 'text-align: {{VALUE}};',
),
'classes' => 'jet-elements-text-align-control',
),
25
);
$this->__add_control(
'desc_color',
array(
'label' => esc_html__( 'Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['desc'] => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'desc_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['desc'],
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_TEXT,
),
),
50
);
$this->__add_responsive_control(
'desc_padding',
array(
'label' => __( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['desc'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
100
);
$this->__add_responsive_control(
'desc_margin',
array(
'label' => __( 'Margin', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['desc'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__end_controls_section();
/**
* Action Button Style Section
*/
$this->__start_controls_section(
'section_action_button_style',
array(
'label' => esc_html__( 'Action Button', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_responsive_control(
'button_alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-tabs' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'flex-start',
'options' => array(
'flex-start' => array(
'title' => ! is_rtl() ? esc_html__( 'Left', 'jet-tabs' ) : esc_html__( 'Right', 'jet-tabs' ),
'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-tabs' ),
'icon' => 'eicon-h-align-center',
),
'flex-end' => array(
'title' => ! is_rtl() ? esc_html__( 'Right', 'jet-tabs' ) : esc_html__( 'Left', 'jet-tabs' ),
'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] => 'align-self: {{VALUE}};',
),
),
25
);
$this->__add_responsive_control(
'button_padding',
array(
'label' => esc_html__( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__add_responsive_control(
'button_margin',
array(
'label' => __( 'Margin', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__start_controls_tabs( 'tabs_button_style' );
$this->__start_controls_tab(
'tab_button_normal',
array(
'label' => esc_html__( 'Normal', 'jet-tabs' ),
)
);
$this->__add_control(
'button_color',
array(
'label' => esc_html__( 'Text Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] => 'color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'button_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'global' => array(
'default' => Global_Colors::COLOR_PRIMARY,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] => 'background-color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'button_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['button'],
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_ACCENT,
),
),
50
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'button_border',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['button'],
),
50
);
$this->__add_responsive_control(
'button_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'button_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['button'],
),
100
);
$this->__end_controls_tab();
$this->__start_controls_tab(
'tab_button_hover',
array(
'label' => esc_html__( 'Hover', 'jet-tabs' ),
)
);
$this->__add_control(
'button_hover_color',
array(
'label' => esc_html__( 'Text Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] . ':hover' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'primary_button_hover_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] . ':hover' => 'background-color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'button_hover_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['button'] . ':hover',
),
50
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'button_hover_border',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['button'] . ':hover',
),
50
);
$this->__add_responsive_control(
'button_hover_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] . ':hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'button_hover_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['button'] . ':hover',
),
100
);
$this->__end_controls_tab();
$this->__end_controls_tabs();
$this->__end_controls_section();
/**
* Order Style Section
*/
$this->__start_controls_section(
'section_order_style',
array(
'label' => esc_html__( 'Content Order and Alignment', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_control(
'title_order',
array(
'label' => esc_html__( 'Title Order', 'jet-tabs' ),
'type' => Controls_Manager::NUMBER,
'default' => 1,
'min' => 1,
'max' => 3,
'step' => 1,
'selectors' => array(
'{{WRAPPER}} '. $css_scheme['title'] => 'order: {{VALUE}};',
),
),
25
);
$this->__add_control(
'desc_order',
array(
'label' => esc_html__( 'Description Order', 'jet-tabs' ),
'type' => Controls_Manager::NUMBER,
'default' => 2,
'min' => 1,
'max' => 3,
'step' => 1,
'selectors' => array(
'{{WRAPPER}} '. $css_scheme['desc'] => 'order: {{VALUE}};',
),
),
25
);
$this->__add_control(
'button_order',
array(
'label' => esc_html__( 'Button Order', 'jet-tabs' ),
'type' => Controls_Manager::NUMBER,
'default' => 3,
'min' => 1,
'max' => 3,
'step' => 1,
'selectors' => array(
'{{WRAPPER}} '. $css_scheme['button'] => 'order: {{VALUE}};',
),
),
25
);
$this->__end_controls_section();
}
/**
* [render description]
* @return [type] [description]
*/
protected function render() {
$this->__context = 'render';
$this->__open_wrap();
include $this->__get_global_template( 'index' );
$this->__close_wrap();
}
/**
* Generate setting json
*
* @return string
*/
public function generate_setting_json() {
$module_settings = $this->get_settings();
$settings = array(
'orientation' => $module_settings['instance_orientation'] ?? 'vertical',
'activeSize' => $module_settings['active_size'],
'duration' => $module_settings['anim_duration'],
'activeItem' => $this->get_active_item(),
);
$settings = json_encode( $settings );
return $settings;
}
/**
* [__generate_action_button description]
* @param boolean $cover_location [description]
* @return [type] [description]
*/
public function __generate_action_button( $cover_location = false ) {
$item = $this->__processed_item;
$button_url = $item[ 'item_link' ];
$button_text = $item[ 'item_link_text' ];
if ( empty( $button_url ) ) {
return false;
}
if ( is_array( $button_url ) && empty( $button_url['url'] ) ) {
return false;
}
$attr_name = 'url_' . $this->item_count;
$this->add_render_attribute( $attr_name, 'class', array(
'elementor-button',
'elementor-size-md',
'jet-image-accordion__button',
) );
$this->add_render_attribute( $attr_name, 'role', 'button' );
$this->add_render_attribute( $attr_name, 'tabindex', 0 );
if ( is_array( $button_url ) ) {
if ( method_exists( $this, 'add_link_attributes' ) ) {
$this->add_link_attributes( $attr_name, $button_url );
} else {
$this->add_render_attribute( $attr_name, 'href', $button_url['url'] );
if ( $button_url['is_external'] ) {
$this->add_render_attribute( $attr_name, 'target', '_blank' );
}
if ( ! empty( $button_url['nofollow'] ) ) {
$this->add_render_attribute( $attr_name, 'rel', 'nofollow' );
}
}
} else {
$this->add_render_attribute( $attr_name, 'href', $button_url );
}
$format = apply_filters( 'jet-tabs/image-accordion/action-button-format', '%2$s' );
$this->item_count++;
return sprintf( $format, $this->get_render_attribute_string( $attr_name ), $button_text );
}
/**
* Get active toggle item
*
* @return int
*/
public function get_active_item() {
$active_index = -1;
$items = $this->get_settings( 'item_list' );
$items = apply_filters( 'jet-tabs/widget/loop-items', $items, 'item_list', $this );
foreach ( $items as $index => $item ) {
if ( array_key_exists( 'item_active', $item ) && filter_var( $item['item_active'], FILTER_VALIDATE_BOOLEAN ) ) {
$active_index = $index;
}
}
return $active_index;
}
/**
* Get item image
*/
public function __loop_item_image() {
$settings = $this->get_settings_for_display();
$item = $this->__processed_item;
$image = $item['item_image'];
$size = isset( $settings['img_size'] ) ? $settings['img_size'] : 'full';
$format = '
';
if ( empty( $image['id'] ) && empty( $image['url'] ) ) {
return sprintf( $format, Utils::get_placeholder_image_src(), '' );
}
if ( empty( $image['id'] ) ) {
return sprintf( $format, $image['url'], '' );
}
$src = wp_get_attachment_image_url( $image['id'], $size );
$alt = Control_Media::get_image_alt( $image );
return sprintf( $format, esc_url( $src ), esc_attr( $alt ) );
}
/**
* Returns image size array in slug => name format
*
* @return array
*/
public function get_image_sizes() {
global $_wp_additional_image_sizes;
$sizes = get_intermediate_image_sizes();
$result = array();
foreach ( $sizes as $size ) {
if ( in_array( $size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
$result[ $size ] = ucwords( trim( str_replace( array( '-', '_' ), array( ' ', ' ' ), $size ) ) );
} else {
$result[ $size ] = sprintf(
'%1$s (%2$sx%3$s)',
ucwords( trim( str_replace( array( '-', '_' ), array( ' ', ' ' ), $size ) ) ),
$_wp_additional_image_sizes[ $size ]['width'],
$_wp_additional_image_sizes[ $size ]['height']
);
}
}
return array_merge( array( 'full' => esc_html__( 'Full', 'jet-elements' ), ), $result );
}
}
jet-switcher-widget.php 0000755 00000056446 15111615464 0011174 0 ustar 00 '.jet-switcher',
'control_wrapper' => '.jet-switcher > .jet-switcher__control-wrapper',
'control' => '.jet-switcher > .jet-switcher__control-wrapper > .jet-switcher__control-instance',
'disable_control' => '.jet-switcher.jet-switcher--disable > .jet-switcher__control-wrapper',
'enable_control' => '.jet-switcher.jet-switcher--enable > .jet-switcher__control-wrapper',
'content_wrapper' => '.jet-switcher > .jet-switcher__content-wrapper',
'content' => '.jet-switcher > .jet-switcher__content-wrapper > .jet-switcher__content',
)
);
$this->start_controls_section(
'section_items_data',
array(
'label' => esc_html__( 'Items', 'jet-tabs' ),
)
);
$this->start_controls_tabs( 'swither_content_tabs' );
$this->start_controls_tab(
'swither_content_tabs_disable_state',
array(
'label' => esc_html__( 'Disable', 'jet-tabs' ),
)
);
$this->add_control(
'disable_label',
array(
'label' => esc_html__( 'Label', 'jet-tabs' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Disable', 'jet-tabs' ),
'dynamic' => array(
'active' => true,
),
)
);
$this->add_control(
'disable_content_type',
array(
'label' => esc_html__( 'Content Type', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'default' => 'template',
'options' => array(
'template' => esc_html__( 'Template', 'jet-tabs' ),
'editor' => esc_html__( 'Editor', 'jet-tabs' ),
),
'label_block' => 'true',
)
);
$this->add_control(
'disable_template_id',
array(
'label' => esc_html__( 'Template', 'jet-tabs' ),
'type' => 'jet-query',
'query_type' => 'elementor_templates',
'edit_button' => array(
'active' => true,
'label' => esc_html__( 'Edit Template', 'jet-tabs' ),
),
'condition' => array(
'disable_content_type' => 'template',
)
)
);
$this->add_control(
'disable_item_editor_content',
array(
'label' => esc_html__( 'Content', 'jet-tabs' ),
'type' => Controls_Manager::WYSIWYG,
'default' => esc_html__( 'Tab Item Content', 'jet-tabs' ),
'dynamic' => array(
'active' => true,
),
'condition' => array(
'disable_content_type' => 'editor',
)
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'swither_content_tabs_enable_state',
array(
'label' => esc_html__( 'Enable', 'jet-tabs' ),
)
);
$this->add_control(
'enable_label',
array(
'label' => esc_html__( 'Label', 'jet-tabs' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Enable', 'jet-tabs' ),
'dynamic' => array(
'active' => true,
),
)
);
$this->add_control(
'enable_content_type',
array(
'label' => esc_html__( 'Content Type', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'default' => 'template',
'options' => array(
'template' => esc_html__( 'Template', 'jet-tabs' ),
'editor' => esc_html__( 'Editor', 'jet-tabs' ),
),
'label_block' => 'true',
)
);
$this->add_control(
'enable_template_id',
array(
'label' => esc_html__( 'Template', 'jet-tabs' ),
'type' => 'jet-query',
'query_type' => 'elementor_templates',
'edit_button' => array(
'active' => true,
'label' => esc_html__( 'Edit Template', 'jet-tabs' ),
),
'condition' => array(
'enable_content_type' => 'template',
)
)
);
$this->add_control(
'enable_item_editor_content',
array(
'label' => esc_html__( 'Content', 'jet-tabs' ),
'type' => Controls_Manager::WYSIWYG,
'default' => esc_html__( 'Tab Item Content', 'jet-tabs' ),
'dynamic' => array(
'active' => true,
),
'condition' => array(
'enable_content_type' => 'editor',
)
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
$this->start_controls_section(
'section_settings_data',
array(
'label' => esc_html__( 'Settings', 'jet-tabs' ),
)
);
$this->add_control(
'initial_state',
array(
'label' => esc_html__( 'Initial State', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Enable', 'jet-tabs' ),
'label_off' => esc_html__( 'Disable', 'jet-tabs' ),
'return_value' => 'yes',
'default' => 'false',
)
);
$this->add_control(
'switcher_preset',
array(
'label' => esc_html__( 'Switcher Preset', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'default' => 'preset-1',
'options' => array(
'preset-1' => esc_html__( 'Preset-1', 'jet-tabs' ),
'preset-2' => esc_html__( 'Preset-2', 'jet-tabs' ),
),
)
);
$this->add_control(
'show_effect',
array(
'label' => esc_html__( 'Show Effect', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'default' => 'move-up',
'options' => array(
'none' => esc_html__( 'None', 'jet-tabs' ),
'fade' => esc_html__( 'Fade', 'jet-tabs' ),
'zoom-in' => esc_html__( 'Zoom In', 'jet-tabs' ),
'zoom-out' => esc_html__( 'Zoom Out', 'jet-tabs' ),
'move-up' => esc_html__( 'Move Up', 'jet-tabs' ),
'fall-perspective' => esc_html__( 'Fall Perspective', 'jet-tabs' ),
),
)
);
$this->end_controls_section();
$this->__start_controls_section(
'section_swither_control_style',
array(
'label' => esc_html__( 'Switcher Control', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_responsive_control(
'swither_control_width',
array(
'label' => esc_html__( 'Width', 'jet-tabs' ),
'type' => Controls_Manager::NUMBER,
'default' => 180,
'min' => 20,
'max' => 300,
'step' => 1,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] => 'width: {{VALUE}}px',
),
),
25
);
$this->__add_responsive_control(
'swither_control_height',
array(
'label' => esc_html__( 'Height', 'jet-tabs' ),
'type' => Controls_Manager::NUMBER,
'default' => 60,
'min' => 10,
'max' => 100,
'step' => 1,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] => 'height: {{VALUE}}px',
),
),
25
);
$this->__add_responsive_control(
'swither_handler_width',
array(
'label' => esc_html__( 'Handler Width', 'jet-tabs' ),
'type' => Controls_Manager::NUMBER,
'default' => 60,
'min' => 1,
'max' => 300,
'step' => 1,
'condition' => array(
'switcher_preset' => 'preset-2',
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ' .jet-switcher__control-handler' => 'width: {{VALUE}}px',
'{{WRAPPER}} ' . $css_scheme['enable_control'] . ' .jet-switcher__control-handler' => 'left: calc(100% - {{VALUE}}px)',
),
)
);
$this->__add_responsive_control(
'swither_container_margin',
array(
'label' => esc_html__( 'Margin', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control_wrapper'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'swither_container_border',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'],
),
50
);
$this->__add_responsive_control(
'swither_container_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'swither_container_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'],
),
100
);
$this->__add_control(
'handler_style_heading',
array(
'label' => esc_html__( 'Handler', 'jet-tabs' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
),
75
);
$this->__add_responsive_control(
'swither_handler_offset',
array(
'label' => esc_html__( 'Handler Offset', 'jet-tabs' ),
'type' => Controls_Manager::NUMBER,
'default' => 3,
'min' => 0,
'max' => 20,
'step' => 1,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ' .jet-switcher__control-handler span' => 'margin: {{VALUE}}px',
),
),
75
);
$this->__add_control(
'labels_style_heading',
array(
'label' => esc_html__( 'Typography', 'jet-tabs' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
),
50
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'label' => esc_html__( 'Labels', 'jet-tabs' ),
'name' => 'swither_control_labels_typography',
'selector' => '{{WRAPPER}} '. $css_scheme['control_wrapper'] . ' .jet-switcher__label-text',
),
50
);
$this->__add_control(
'control_state_style_heading',
array(
'label' => esc_html__( 'States', 'jet-tabs' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
)
);
$this->__start_controls_tabs( 'swither_control_styles_tabs' );
$this->__start_controls_tab(
'swither_control_styles_disable_tab',
array(
'label' => esc_html__( 'Disable', 'jet-tabs' ),
)
);
$this->__add_control(
'control_disable_background_color',
array(
'label' => esc_html__( 'Control Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['disable_control'] . ' .jet-switcher__control-instance' => 'background-color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'control_handler_disable_background_color',
array(
'label' => esc_html__( 'Handler Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['disable_control'] . ' .jet-switcher__control-handler span' => 'background-color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'control_disable_state_disable_label_color',
array(
'label' => esc_html__( 'Disable Label Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['disable_control'] . ' .jet-switcher__control--disable' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'control_disable_state_enable_label_color',
array(
'label' => esc_html__( 'Enable Label Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['disable_control'] . ' .jet-switcher__control--enable' => 'color: {{VALUE}}',
),
),
25
);
$this->__end_controls_tab();
$this->__start_controls_tab(
'swither_control_styles_enable_tab',
array(
'label' => esc_html__( 'Enable', 'jet-tabs' ),
)
);
$this->__add_control(
'control_enable_background_color',
array(
'label' => esc_html__( 'Control Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['enable_control'] . ' .jet-switcher__control-instance' => 'background-color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'control_handler_enable_background_color',
array(
'label' => esc_html__( 'Handler Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['enable_control'] . ' .jet-switcher__control-handler span' => 'background-color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'control_enable_state_disable_label_color',
array(
'label' => esc_html__( 'Disable Label Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['enable_control'] . ' .jet-switcher__control--disable' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'control_enable_state_enable_label_color',
array(
'label' => esc_html__( 'Enable Label Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['enable_control'] . ' .jet-switcher__control--enable' => 'color: {{VALUE}}',
),
),
25
);
$this->__end_controls_tab();
$this->__end_controls_tabs();
$this->__end_controls_section();
/**
* Swither Content Style Section
*/
$this->__start_controls_section(
'section_swither_content_style',
array(
'label' => esc_html__( 'Switcher Content', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'tabs_content_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['content'],
),
50
);
$this->__add_control(
'tabs_content_text_color',
array(
'label' => esc_html__( 'Text color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content'] => 'color: {{VALUE}};',
),
),
25
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'swither_content_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['content_wrapper'],
),
25
);
$this->__add_responsive_control(
'swither_content_padding',
array(
'label' => esc_html__( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'swither_content_border',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['content_wrapper'],
),
50
);
$this->__add_responsive_control(
'swither_content_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content_wrapper'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'tabs_content_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['content_wrapper'],
),
100
);
$this->__end_controls_section();
}
/**
* [render description]
* @return [type] [description]
*/
protected function render() {
$this->__context = 'render';
$widget_settings = $this->get_settings_for_display();
$show_effect = $widget_settings[ 'show_effect' ];
$switcher_preset = $widget_settings[ 'switcher_preset' ];
$initial_state = filter_var( $widget_settings[ 'initial_state' ], FILTER_VALIDATE_BOOLEAN );
$allowed_presets = [ 'preset-1', 'preset-2' ];
$switcher_preset = in_array( $switcher_preset, $allowed_presets ) ? $switcher_preset : 'preset-1';
$settings = array(
'effect' => $widget_settings[ 'show_effect' ],
);
$this->add_render_attribute( 'instance', array(
'class' => array(
'jet-switcher',
'jet-switcher--' . $switcher_preset,
'jet-switcher-' . $show_effect . '-effect',
$initial_state ? 'jet-switcher--enable' : 'jet-switcher--disable',
),
'data-settings' => json_encode( $settings ),
) );
?>get_render_attribute_string( 'instance' ); // phpcs:ignore ?>>
get_template(
$this->get_name() . '/global/' . sanitize_file_name( $switcher_preset ) . '.php'
);
?>
add_render_attribute( 'jet_switcher_content_disable', array(
'id' => 'jet-switcher-content-disable-' . $this->get_id(),
'class' => array(
'jet-switcher__content',
'jet-switcher__content--disable',
! $initial_state ? 'active-content' : '',
),
'aria-hidden' => ! $initial_state ? 'false' : 'true',
) );
switch ( $widget_settings['disable_content_type'] ) {
case 'template':
$disable_content_html = $this->get_template_content_by_id( $widget_settings['disable_template_id'] );
break;
case 'editor':
$disable_content_html = $this->parse_text_editor( $widget_settings['disable_item_editor_content'] );
break;
}
echo sprintf( '
%2$s
', $this->get_render_attribute_string( 'jet_switcher_content_disable' ), $disable_content_html ); // phpcs:ignore
$this->add_render_attribute( 'jet_switcher_content_enable', array(
'id' => 'jet-switcher-content-enable-' . $this->get_id(),
'class' => array(
'jet-switcher__content',
'jet-switcher__content--enable',
$initial_state ? 'active-content' : '',
),
'aria-hidden' => $initial_state ? 'false' : 'true',
) );
switch ( $widget_settings['enable_content_type'] ) {
case 'template':
$enable_content_html = $this->get_template_content_by_id( $widget_settings['enable_template_id'] );
break;
case 'editor':
$enable_content_html = $this->parse_text_editor( $widget_settings['enable_item_editor_content'] );
break;
}
echo sprintf( '
%2$s
', $this->get_render_attribute_string( 'jet_switcher_content_enable' ), $enable_content_html );// phpcs:ignore ?>
elementor()->frontend->get_builder_content( $template_id );
if ( ! empty( $template_content ) ) {
$content_html .= $template_content;
if ( jet_tabs_integration()->is_edit_mode() ) {
$link = add_query_arg(
array(
'elementor' => '',
),
get_permalink( $template_id )
);
$content_html .= sprintf( '%s
', $link, esc_html__( 'Edit Template', 'jet-tabs' ) );
}
} else {
$content_html = $this->no_template_content_message();
}
} else {
$content_html = $this->no_templates_message();
}
return $content_html;
}
/**
* [empty_templates_message description]
* @return [type] [description]
*/
public function empty_templates_message() {
return '';
}
/**
* [no_templates_message description]
* @return [type] [description]
*/
public function no_templates_message() {
$message = '' . esc_html__( 'Template is not defined. ', 'jet-tabs' ) . '';
$link = add_query_arg(
array(
'post_type' => 'elementor_library',
'action' => 'elementor_new_post',
'_wpnonce' => wp_create_nonce( 'elementor_action_new_post' ),
'template_type' => 'section',
),
esc_url( admin_url( '/edit.php' ) )
);
$new_link = '' . esc_html__( 'Select an existing template or create a ', 'jet-tabs' ) . '' . esc_html__( 'new one', 'jet-tabs' ) . '' ;
return sprintf(
'%1$s%2$s
',
$message,
jet_tabs_integration()->in_elementor() ? $new_link : ''
);
}
/**
* [no_template_content_message description]
* @return [type] [description]
*/
public function no_template_content_message() {
$message = '' . esc_html__( 'The switcher are working. Please, note, that you have to add a template to the library in order to be able to display it inside the switcher.', 'jet-tabs' ) . '';
return sprintf( '%1$s
', $message );
}
/**
* [get_template_edit_link description]
* @param [type] $template_id [description]
* @return [type] [description]
*/
public function get_template_edit_link( $template_id ) {
$link = add_query_arg( 'elementor', '', get_permalink( $template_id ) );
return ' ' . esc_html__( 'Edit Template', 'jet-tabs' ) . '';
}
}
jet-tabs-widget.php 0000755 00000206744 15111615464 0010273 0 ustar 00 '> .elementor-widget-container > .jet-tabs',
'control_wrapper' => '> .elementor-widget-container > .jet-tabs > .jet-tabs__control-wrapper',
'control' => '> .elementor-widget-container > .jet-tabs > .jet-tabs__control-wrapper > .jet-tabs__control',
'content_wrapper' => '> .elementor-widget-container > .jet-tabs > .jet-tabs__content-wrapper',
'content' => '> .elementor-widget-container > .jet-tabs > .jet-tabs__content-wrapper > .jet-tabs__content',
'label' => '.jet-tabs__label-text',
'icon' => '.jet-tabs__label-icon',
'control_swiper_wrapper' => '> .elementor-widget-container > .jet-tabs > .jet-tabs__control-wrapper > .jet-tabs-swiper-container > .swiper-wrapper',
'control_swiper' => '> .elementor-widget-container > .jet-tabs > .jet-tabs__control-wrapper > .jet-tabs-swiper-container > .swiper-wrapper > .jet-tabs__control',
)
);
$this->start_controls_section(
'section_items_data',
array(
'label' => esc_html__( 'Items', 'jet-tabs' ),
)
);
do_action( 'jet-engine-query-gateway/control', $this, 'tabs' );
$repeater = new Repeater();
$repeater->add_control(
'item_active',
array(
'label' => esc_html__( 'Active', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Yes', 'jet-tabs' ),
'label_off' => esc_html__( 'No', 'jet-tabs' ),
'return_value' => 'yes',
'default' => 'false',
)
);
$repeater->add_control(
'item_use_image',
array(
'label' => esc_html__( 'Use Image?', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Yes', 'jet-tabs' ),
'label_off' => esc_html__( 'No', 'jet-tabs' ),
'return_value' => 'yes',
'default' => 'false',
)
);
$repeater->add_control(
$this->__new_icon_prefix . 'item_icon',
array(
'label' => esc_html__( 'Icon', 'jet-tabs' ),
'type' => Controls_Manager::ICONS,
'label_block' => false,
'skin' => 'inline',
'fa4compatibility' => 'item_icon',
'default' => array(
'value' => 'fas fa-arrow-circle-right',
'library' => 'fa-solid',
),
)
);
$repeater->add_control(
'item_image',
array(
'label' => esc_html__( 'Image', 'jet-tabs' ),
'type' => Controls_Manager::MEDIA,
'dynamic' => array(
'active' => true,
),
)
);
$repeater->add_control(
'item_label',
array(
'label' => esc_html__( 'Label', 'jet-tabs' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'New Tab', 'jet-tabs' ),
'dynamic' => array(
'active' => true,
),
)
);
$repeater->add_control(
'content_type',
array(
'label' => esc_html__( 'Content Type', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'default' => 'template',
'options' => array(
'template' => esc_html__( 'Template', 'jet-tabs' ),
'editor' => esc_html__( 'Editor', 'jet-tabs' ),
),
'label_block' => 'true',
)
);
$repeater->add_control(
'item_template_id',
array(
'label' => esc_html__( 'Choose Template', 'jet-tabs' ),
'type' => 'jet-query',
'query_type' => 'elementor_templates',
'edit_button' => array(
'active' => true,
'label' => esc_html__( 'Edit Template', 'jet-tabs' ),
),
'condition' => array(
'content_type' => 'template',
)
)
);
$repeater->add_control(
'item_editor_content',
array(
'label' => esc_html__( 'Content', 'jet-tabs' ),
'type' => Controls_Manager::WYSIWYG,
'default' => esc_html__( 'Tab Item Content', 'jet-tabs' ),
'dynamic' => array(
'active' => true,
),
'condition' => array(
'content_type' => 'editor',
)
)
);
$repeater->add_control(
'control_id',
array(
'label' => esc_html__( 'Control CSS ID', 'jet-tabs' ),
'type' => Controls_Manager::TEXT,
'dynamic' => array(
'active' => true,
),
)
);
$this->add_control(
'tabs',
array(
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'default' => array(
array(
'item_label' => esc_html__( 'Tab #1', 'jet-tabs' ),
),
array(
'item_label' => esc_html__( 'Tab #2', 'jet-tabs' ),
),
array(
'item_label' => esc_html__( 'Tab #3', 'jet-tabs' ),
),
),
'title_field' => '{{{ item_label }}}',
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_settings_data',
array(
'label' => esc_html__( 'Settings', 'jet-tabs' ),
)
);
$this->add_control(
'item_html_tag',
array(
'label' => esc_html__( 'Item Label HTML Tag', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'options' => $this->get_available_item_html_tags(),
'default' => 'div',
)
);
$this->add_responsive_control(
'tabs_position',
array(
'label' => esc_html__( 'Tabs Position', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'default' => 'top',
'options' => array(
'left' => esc_html__( 'Left', 'jet-tabs' ),
'top' => esc_html__( 'Top', 'jet-tabs' ),
'right' => esc_html__( 'Right', 'jet-tabs' ),
'bottom' => esc_html__( 'Bottom', 'jet-tabs' ),
),
'frontend_available' => true,
'render_type' => 'template',
)
);
$this->add_control(
'show_effect',
array(
'label' => esc_html__( 'Show Effect', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'default' => 'move-up',
'options' => array(
'none' => esc_html__( 'None', 'jet-tabs' ),
'fade' => esc_html__( 'Fade', 'jet-tabs' ),
'zoom-in' => esc_html__( 'Zoom In', 'jet-tabs' ),
'zoom-out' => esc_html__( 'Zoom Out', 'jet-tabs' ),
'move-up' => esc_html__( 'Move Up', 'jet-tabs' ),
'fall-perspective' => esc_html__( 'Fall Perspective', 'jet-tabs' ),
),
)
);
$this->add_control(
'tabs_event',
array(
'label' => esc_html__( 'Tabs Event', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'default' => 'click',
'options' => array(
'click' => esc_html__( 'Click', 'jet-tabs' ),
'hover' => esc_html__( 'Hover', 'jet-tabs' ),
),
)
);
$this->add_control(
'auto_switch',
array(
'label' => esc_html__( 'Auto Switch', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'jet-tabs' ),
'label_off' => esc_html__( 'Off', 'jet-tabs' ),
'return_value' => 'yes',
'default' => 'false',
)
);
$this->add_control(
'auto_switch_delay',
array(
'label' => esc_html__( 'Auto Switch Delay', 'jet-tabs' ),
'type' => Controls_Manager::NUMBER,
'default' => 3000,
'min' => 1000,
'max' => 20000,
'step' => 100,
'condition' => array(
'auto_switch' => 'yes',
),
)
);
$this->add_control(
'no_active_tabs',
array(
'label' => esc_html__( 'No Active Tabs', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'jet-tabs' ),
'label_off' => esc_html__( 'Off', 'jet-tabs' ),
'return_value' => 'yes',
'default' => 'false',
'frontend_available' => true,
)
);
$this->add_control(
'ajax_template',
array(
'label' => esc_html__( 'Use Ajax Loading for Template', 'jet-tabs' ),
'description' => wp_kses_post(
sprintf(
__( 'If you need to use dynamic data inside the template, please switch Ajax Request Type to Self.', 'jet-tabs' ),
esc_url( admin_url( 'admin.php?page=jet-dashboard-settings-page&subpage=jet-tabs-general-settings' ) )
)
),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'jet-tabs' ),
'label_off' => esc_html__( 'Off', 'jet-tabs' ),
'return_value' => 'yes',
'default' => 'false',
)
);
$this->add_control(
'tab_control_switching',
array(
'label' => esc_html__( 'Scrolling to the Content', 'jet-tabs' ),
'description' => esc_html__( 'Scrolling to the Content after Switching Tab Control', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'jet-tabs' ),
'label_off' => esc_html__( 'Off', 'jet-tabs' ),
'return_value' => 'yes',
'default' => 'false',
)
);
$this->add_control(
'tab_control_switching_offset',
array(
'label' => esc_html__( 'Scrolling offset (px)', 'jet-tabs' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 0,
'max' => 100,
),
),
'default' => array(
'unit' => 'px',
'size' => 0,
),
'condition' => array(
'tab_control_switching' => 'yes'
)
)
);
$this->add_control(
'tab_scrolling_navigation',
array(
'label' => esc_html__( 'Scrolling Tabs Navigation', 'jet-tabs' ),
'description' => esc_html__( 'Scrolling tabs navigation if it does not fit in viewport', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'jet-tabs' ),
'label_off' => esc_html__( 'Off', 'jet-tabs' ),
'return_value' => 'yes',
'default' => 'false',
'condition' => array(
'tabs_position!' => ['left', 'right'],
),
)
);
$this->add_control(
'tab_scroll_type',
array(
'label' => esc_html__( 'Scroll Type', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'default' => 'plain',
'options' => array(
'plain' => esc_html__( 'Plain', 'jet-tabs' ),
'slider' => esc_html__( 'Slider', 'jet-tabs' ),
),
'condition' => array(
'tab_scrolling_navigation' => 'yes',
'tabs_position!' => ['left', 'right'],
),
)
);
$this->add_control(
'fixed_slide_width',
array(
'label' => esc_html__( 'Fixed Slide Width', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'jet-tabs' ),
'label_off' => esc_html__( 'Off', 'jet-tabs' ),
'return_value' => 'yes',
'default' => 'false',
'condition' => array(
'tab_scrolling_navigation' => 'yes',
'tab_scroll_type' => 'slider',
'tabs_position!' => ['left', 'right'],
),
)
);
$this->add_control(
'slide_width_value',
array(
'label' => esc_html__( 'Slide Width', 'jet-tabs' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px', '%', 'em' ),
'range' => array(
'px' => array(
'min' => 50,
'max' => 500,
),
'%' => array(
'min' => 10,
'max' => 100,
),
'em' => array(
'min' => 1,
'max' => 50,
),
),
'default' => array(
'unit' => 'px',
'size' => 200,
),
'condition' => array(
'tabs_position!' => ['left', 'right'],
'tab_scrolling_navigation' => 'yes',
'tab_scroll_type' => 'slider',
'fixed_slide_width' => 'yes',
),
)
);
$this->add_control(
'slider_centered',
array(
'label' => esc_html__( 'Centered', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'jet-tabs' ),
'label_off' => esc_html__( 'Off', 'jet-tabs' ),
'return_value' => 'yes',
'default' => '',
'condition' => array(
'tab_scrolling_navigation' => 'yes',
'tab_scroll_type' => 'slider',
'tabs_position!' => ['left', 'right'],
),
)
);
$this->add_control(
'slider_looped',
array(
'label' => esc_html__( 'Looped', 'jet-tabs' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'jet-tabs' ),
'label_off' => esc_html__( 'Off', 'jet-tabs' ),
'return_value' => 'yes',
'default' => '',
'condition' => array(
'tab_scrolling_navigation' => 'yes',
'tab_scroll_type' => 'slider',
'tabs_position!' => ['left', 'right'],
),
)
);
$this->add_control(
'slider_show_nav',
array(
'type' => Controls_Manager::SWITCHER,
'label' => __( 'Enable Navigation', 'jet-tabs' ),
'label_on' => esc_html__( 'On', 'jet-tabs' ),
'label_off' => esc_html__( 'Off', 'jet-tabs' ),
'return_value' => 'yes',
'default' => 'false',
'condition' => array(
'tabs_position!' => ['left', 'right'],
'tab_scrolling_navigation' => 'yes',
'tab_scroll_type' => 'slider',
),
)
);
$this->end_controls_section();
$this->__start_controls_section(
'section_general_style',
array(
'label' => esc_html__( 'General', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_responsive_control(
'tabs_control_wrapper_width',
array(
'label' => esc_html__( 'Tabs Control Width', 'jet-tabs' ),
'description' => esc_html__( 'Working with left or right tabs position', 'jet-tabs' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array(
'px', '%',
),
'range' => array(
'%' => array(
'min' => 10,
'max' => 50,
),
'px' => array(
'min' => 100,
'max' => 500,
),
),
'selectors' => array(
'{{WRAPPER}} .jet-tabs.jet-tabs-position-left > .jet-tabs__control-wrapper' => 'min-width: {{SIZE}}{{UNIT}}',
'{{WRAPPER}} .jet-tabs.jet-tabs-position-right > .jet-tabs__control-wrapper' => 'min-width: {{SIZE}}{{UNIT}}',
'{{WRAPPER}} .jet-tabs.jet-tabs-position-left > .jet-tabs__content-wrapper' => 'min-width: calc(100% - {{SIZE}}{{UNIT}})',
'{{WRAPPER}} .jet-tabs.jet-tabs-position-right > .jet-tabs__content-wrapper' => 'min-width: calc(100% - {{SIZE}}{{UNIT}})',
),
),
25
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'tabs_container_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['instance'],
),
25
);
$this->__add_responsive_control(
'tabs_container_padding',
array(
'label' => esc_html__( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['instance'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__add_responsive_control(
'tabs_container_margin',
array(
'label' => esc_html__( 'Margin', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['instance'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'tabs_container_border',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['instance'],
),
100
);
$this->__add_responsive_control(
'tabs_container_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['instance'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
100
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'tabs_container_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['instance'],
),
100
);
$this->__end_controls_section();
/**
* Tabs Control Style Section
*/
$this->__start_controls_section(
'section_tabs_control_style',
array(
'label' => esc_html__( 'Tabs Control', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_responsive_control(
'tabs_controls_container_aligment',
array(
'label' => esc_html__( 'Tabs Container Alignment', 'jet-tabs' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'flex-start',
'options' => array(
'flex-start' => array(
'title' => ! is_rtl() ? esc_html__( 'Start', 'jet-tabs' ) : esc_html__( 'End', 'jet-tabs' ),
'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-tabs' ),
'icon' => 'eicon-h-align-center',
),
'flex-end' => array(
'title' => ! is_rtl() ? esc_html__( 'End', 'jet-tabs' ) : esc_html__( 'Start', 'jet-tabs' ),
'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left',
),
'stretch' => array(
'title' => esc_html__( 'Stretch', 'jet-tabs' ),
'icon' => 'eicon-h-align-stretch',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control_wrapper'] => 'align-self: {{VALUE}};',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] => 'align-self: {{VALUE}};',
),
),
100
);
$this->__add_responsive_control(
'tabs_controls_aligment',
array(
'label' => esc_html__( 'Tabs Alignment', 'jet-tabs' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'flex-start',
'options' => array(
'flex-start' => array(
'title' => ! is_rtl() ? esc_html__( 'Start', 'jet-tabs' ) : esc_html__( 'End', 'jet-tabs' ),
'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-tabs' ),
'icon' => 'eicon-h-align-center',
),
'flex-end' => array(
'title' => ! is_rtl() ? esc_html__( 'End', 'jet-tabs' ) : esc_html__( 'Start', 'jet-tabs' ),
'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left',
),
'stretch' => array(
'title' => esc_html__( 'Stretch', 'jet-tabs' ),
'icon' => 'eicon-h-align-stretch',
),
),
'selectors_dictionary' => array(
'flex-start' => 'justify-content: flex-start;',
'center' => 'justify-content: center;',
'flex-end' => 'justify-content: flex-end;',
'stretch' => 'flex-grow: 1;',
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control_wrapper'] => '{{VALUE}}',
'{{WRAPPER}} ' . $css_scheme['control'] => '{{VALUE}}',
),
),
100
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'tabs_content_wrapper_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['control_wrapper'],
),
25
);
$this->__add_responsive_control(
'tabs_control_wrapper_padding',
array(
'label' => esc_html__( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control_wrapper'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__add_responsive_control(
'tabs_control_wrapper_margin',
array(
'label' => esc_html__( 'Margin', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control_wrapper'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'tabs_control_wrapper_border',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['control_wrapper'],
),
25
);
$this->__add_responsive_control(
'tabs_control_wrapper_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control_wrapper'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'tabs_control_wrapper_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['control_wrapper'],
),
100
);
$this->__end_controls_section();
/**
* Tabs Control Style Section
*/
$this->__start_controls_section(
'section_tabs_control_item_style',
array(
'label' => esc_html__( 'Tabs Control Item', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_responsive_control(
'tabs_controls_item_aligment_left_right_icon',
array(
'label' => esc_html__( 'Alignment', 'jet-tabs' ),
'description' => esc_html__( 'Working with left or right tabs position and left or right icon position', 'jet-tabs' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'center',
'options' => array(
'flex-start' => array(
'title' => esc_html__( 'Start', 'jet-tabs' ),
'icon' => 'eicon-arrow-left',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-tabs' ),
'icon' => 'eicon-text-align-center',
),
'flex-end' => array(
'title' => esc_html__( 'End', 'jet-tabs' ),
'icon' => 'eicon-arrow-right',
),
),
'condition' => array(
'tabs_position!' => ['top', 'bottom'],
),
'selectors' => array(
'{{WRAPPER}} .jet-tabs.jet-tabs-position-left > .jet-tabs__control-wrapper > .jet-tabs__control.jet-tabs__control-icon-left .jet-tabs__control-inner' => 'justify-content: {{VALUE}};',
'{{WRAPPER}} .jet-tabs.jet-tabs-position-left > .jet-tabs__control-wrapper > .jet-tabs__control.jet-tabs__control-icon-right .jet-tabs__control-inner' => 'justify-content: {{VALUE}};',
'{{WRAPPER}} .jet-tabs.jet-tabs-position-right > .jet-tabs__control-wrapper > .jet-tabs__control.jet-tabs__control-icon-left .jet-tabs__control-inner' => 'justify-content: {{VALUE}};',
'{{WRAPPER}} .jet-tabs.jet-tabs-position-right > .jet-tabs__control-wrapper > .jet-tabs__control.jet-tabs__control-icon-right .jet-tabs__control-inner' => 'justify-content: {{VALUE}};',
),
'classes' => 'jet-tabs-text-align-control',
),
25
);
$this->__add_responsive_control(
'tabs_controls_item_aligment_top_icon',
array(
'label' => esc_html__( 'Alignment', 'jet-tabs' ),
'description' => esc_html__( 'Working with left or right tabs position and top icon position', 'jet-tabs' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'center',
'options' => array(
'flex-start' => array(
'title' => ! is_rtl() ? esc_html__( 'Start', 'jet-tabs' ) : esc_html__( 'End', 'jet-tabs' ),
'icon' => ! is_rtl() ? 'eicon-arrow-left' : 'eicon-arrow-right',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-tabs' ),
'icon' => 'eicon-text-align-center',
),
'flex-end' => array(
'title' => ! is_rtl() ? esc_html__( 'End', 'jet-tabs' ) : esc_html__( 'Start', 'jet-tabs' ),
'icon' => ! is_rtl() ? 'eicon-arrow-right' : 'eicon-arrow-left',
),
),
'condition' => array(
'tabs_position!' => ['top', 'bottom'],
),
'selectors' => array(
'{{WRAPPER}} .jet-tabs.jet-tabs-position-left > .jet-tabs__control-wrapper > .jet-tabs__control.jet-tabs__control-icon-top .jet-tabs__control-inner' => 'align-items: {{VALUE}};',
'{{WRAPPER}} .jet-tabs.jet-tabs-position-right > .jet-tabs__control-wrapper > .jet-tabs__control.jet-tabs__control-icon-top .jet-tabs__control-inner' => 'align-items: {{VALUE}}',
),
),
25
);
$this->__add_control(
'tabs_control_icon_style_devider',
array(
'type' => Controls_Manager::DIVIDER,
)
);
$this->__add_control(
'tabs_control_icon_style_heading',
array(
'label' => esc_html__( 'Icon Styles', 'jet-tabs' ),
'type' => Controls_Manager::HEADING,
)
);
$this->__add_responsive_control(
'tabs_control_icon_margin',
array(
'label' => esc_html__( 'Icon Margin', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ' .jet-tabs__label-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . ' .jet-tabs__label-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__add_responsive_control(
'tabs_control_image_margin',
array(
'label' => esc_html__( 'Image Margin', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ' .jet-tabs__label-image' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . ' .jet-tabs__label-image' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
100
);
$this->__add_responsive_control(
'tabs_control_image_width',
array(
'label' => esc_html__( 'Image Width', 'jet-tabs' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array(
'px', 'em', 'rem', '%',
),
'range' => array(
'px' => array(
'min' => 10,
'max' => 100,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ' .jet-tabs__label-image' => 'width: {{SIZE}}{{UNIT}}',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . ' .jet-tabs__label-image' => 'width: {{SIZE}}{{UNIT}}',
),
),
100
);
$this->__add_control(
'tabs_control_icon_position',
array(
'label' => esc_html__( 'Icon Position', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'default' => 'left',
'options' => array(
'left' => esc_html__( 'Left', 'jet-tabs' ),
'top' => esc_html__( 'Top', 'jet-tabs' ),
'right' => esc_html__( 'Right', 'jet-tabs' ),
),
),
50
);
$this->__add_control(
'tabs_control_state_style_heading',
array(
'label' => esc_html__( 'State Styles', 'jet-tabs' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
)
);
$this->__start_controls_tabs( 'tabs_control_styles' );
$this->__start_controls_tab(
'tabs_control_normal',
array(
'label' => esc_html__( 'Normal', 'jet-tabs' ),
)
);
$this->__add_control(
'tabs_control_label_color',
array(
'label' => esc_html__( 'Text Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'global' => array(
'default' => Global_Colors::COLOR_TEXT,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ' ' . $css_scheme['label'] => 'color: {{VALUE}}',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . ' ' . $css_scheme['label'] => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'tabs_control_label_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . ' ' . $css_scheme['label'] . ', {{WRAPPER}} ' . $css_scheme['control_swiper'] . ' ' . $css_scheme['label'],
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
),
),
50
);
$this->__add_control(
'tabs_control_icon_color',
array(
'label' => esc_html__( 'Icon Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'global' => array(
'default' => Global_Colors::COLOR_TEXT,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ' ' . $css_scheme['icon'] => 'color: {{VALUE}}',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . ' ' . $css_scheme['icon'] => 'color: {{VALUE}}',
),
),
25
);
$this->__add_responsive_control(
'tabs_control_icon_size',
array(
'label' => esc_html__( 'Icon Size', 'jet-tabs' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array(
'px', 'em', 'rem',
),
'range' => array(
'px' => array(
'min' => 18,
'max' => 200,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ' ' . $css_scheme['icon'] => 'font-size: {{SIZE}}{{UNIT}}',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . ' ' . $css_scheme['icon'] => 'font-size: {{SIZE}}{{UNIT}}',
),
),
50
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'tabs_control_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . ', {{WRAPPER}} ' . $css_scheme['control_swiper'],
),
25
);
$this->__add_responsive_control(
'tabs_control_padding',
array(
'label' => esc_html__( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ' .jet-tabs__control-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . ' .jet-tabs__control-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__add_responsive_control(
'tabs_control_margin',
array(
'label' => esc_html__( 'Margin', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'tabs_control_border',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . ', {{WRAPPER}} ' . $css_scheme['control_swiper'],
),
25
);
$this->__add_responsive_control(
'tabs_control_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'tabs_control_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . ', {{WRAPPER}} ' . $css_scheme['control_swiper'],
),
100
);
$this->__end_controls_tab();
$this->__start_controls_tab(
'tabs_control_hover',
array(
'label' => esc_html__( 'Hover', 'jet-tabs' ),
)
);
$this->__add_control(
'tabs_control_label_color_hover',
array(
'label' => esc_html__( 'Text Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'global' => array(
'default' => Global_Colors::COLOR_SECONDARY,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ':hover ' . $css_scheme['label'] => 'color: {{VALUE}}',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . ':hover ' . $css_scheme['label'] => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'tabs_control_label_typography_hover',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . ':hover ' . $css_scheme['label'] . ', {{WRAPPER}} ' . $css_scheme['control_swiper'] . ':hover ' . $css_scheme['label'],
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
),
),
50
);
$this->__add_control(
'tabs_control_icon_color_hover',
array(
'label' => esc_html__( 'Icon Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'global' => array(
'default' => Global_Colors::COLOR_SECONDARY,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ':hover ' . $css_scheme['icon'] => 'color: {{VALUE}}',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . ':hover ' . $css_scheme['icon'] => 'color: {{VALUE}}',
),
),
25
);
$this->__add_responsive_control(
'tabs_control_icon_size_hover',
array(
'label' => esc_html__( 'Icon Size', 'jet-tabs' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array(
'px', 'em', 'rem',
),
'range' => array(
'px' => array(
'min' => 18,
'max' => 200,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ':hover ' . $css_scheme['icon'] => 'font-size: {{SIZE}}{{UNIT}}',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . ':hover ' . $css_scheme['icon'] => 'font-size: {{SIZE}}{{UNIT}}',
),
),
50
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'tabs_control_background_hover',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . ':hover' . ', {{WRAPPER}} ' . $css_scheme['control_swiper'] . ':hover',
),
25
);
$this->__add_responsive_control(
'tabs_control_padding_hover',
array(
'label' => esc_html__( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ':hover' . ' .jet-tabs__control-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . ':hover' . ' .jet-tabs__control-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__add_responsive_control(
'tabs_control_margin_hover',
array(
'label' => esc_html__( 'Margin', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ':hover' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . ':hover' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'tabs_control_border_hover',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . ':hover' . ', {{WRAPPER}} ' . $css_scheme['control_swiper'] . ':hover',
),
25
);
$this->__add_responsive_control(
'tabs_control_border_radius_hover',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . ':hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . ':hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'tabs_control_box_shadow_hover',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . ':hover' . ', {{WRAPPER}} ' . $css_scheme['control_swiper'] . ':hover',
),
100
);
$this->__end_controls_tab();
$this->__start_controls_tab(
'tabs_control_active',
array(
'label' => esc_html__( 'Active', 'jet-tabs' ),
)
);
$this->__add_control(
'tabs_control_label_color_active',
array(
'label' => esc_html__( 'Text Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'global' => array(
'default' => Global_Colors::COLOR_PRIMARY,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . '.active-tab ' . $css_scheme['label'] => 'color: {{VALUE}}',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . '.active-tab ' . $css_scheme['label'] => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'tabs_control_label_typography_active',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . '.active-tab ' . $css_scheme['label'] . ', {{WRAPPER}} ' . $css_scheme['control_swiper'] . '.active-tab ' . $css_scheme['label'],
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
),
),
50
);
$this->__add_control(
'tabs_control_icon_color_active',
array(
'label' => esc_html__( 'Icon Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'global' => array(
'default' => Global_Colors::COLOR_PRIMARY,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . '.active-tab ' . $css_scheme['icon'] => 'color: {{VALUE}}',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . '.active-tab ' . $css_scheme['icon'] => 'color: {{VALUE}}',
),
),
25
);
$this->__add_responsive_control(
'tabs_control_icon_size_active',
array(
'label' => esc_html__( 'Icon Size', 'jet-tabs' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array(
'px', 'em', 'rem',
),
'range' => array(
'px' => array(
'min' => 18,
'max' => 200,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . '.active-tab ' . $css_scheme['icon'] => 'font-size: {{SIZE}}{{UNIT}}',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . '.active-tab ' . $css_scheme['icon'] => 'font-size: {{SIZE}}{{UNIT}}',
),
),
50
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'tabs_control_background_active',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . '.active-tab' . ', {{WRAPPER}} ' . $css_scheme['control_swiper'] . '.active-tab',
),
25
);
$this->__add_responsive_control(
'tabs_control_padding_active',
array(
'label' => esc_html__( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . '.active-tab' . ' .jet-tabs__control-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . '.active-tab' . ' .jet-tabs__control-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__add_responsive_control(
'tabs_control_margin_active',
array(
'label' => esc_html__( 'Margin', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . '.active-tab' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . '.active-tab' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'tabs_control_border_active',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . '.active-tab' . ', {{WRAPPER}} ' . $css_scheme['control_swiper'] . '.active-tab',
),
25
);
$this->__add_responsive_control(
'tabs_control_border_radius_active',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control'] . '.active-tab' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} ' . $css_scheme['control_swiper'] . '.active-tab' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'tabs_control_box_shadow_active',
'selector' => '{{WRAPPER}} ' . $css_scheme['control'] . '.active-tab' . ', {{WRAPPER}} ' . $css_scheme['control_swiper'] . '.active-tab',
),
100
);
$this->__end_controls_tab();
$this->__end_controls_tabs();
$this->__end_controls_section();
/**
* Tabs Content Style Section
*/
$this->__start_controls_section(
'section_tabs_content_style',
array(
'label' => esc_html__( 'Tabs Content', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_control(
'tabs_content_text_color',
array(
'label' => esc_html__( 'Text color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content'] => 'color: {{VALUE}};',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'tabs_content_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['content'],
),
50
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'tabs_content_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['content_wrapper'],
),
25
);
$this->__add_responsive_control(
'tabs_content_padding',
array(
'label' => esc_html__( 'Padding', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'vw', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
50
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'tabs_content_border',
'label' => esc_html__( 'Border', 'jet-tabs' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['content_wrapper'],
),
25
);
$this->__add_responsive_control(
'tabs_content_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-tabs' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content_wrapper'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'custom_units' => true,
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'tabs_content_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['content_wrapper'],
),
100
);
$this->__add_control(
'tabs_content_loader_style_heading',
array(
'label' => esc_html__( 'Loader Styles', 'jet-tabs' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => array(
'ajax_template' => 'yes',
),
),
25
);
$this->__add_control(
'tabs_content_loader_color',
array(
'label' => esc_html__( 'Loader color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content'] . ' .jet-tabs-loader' => 'border-color: {{VALUE}}; border-top-color: white;',
),
'condition' => array(
'ajax_template' => 'yes',
),
),
25
);
$this->__end_controls_section();
/**
* Tabs Slider Navigation
*/
$this->start_controls_section(
'section_navigation_style',
array(
'label' => esc_html__( 'Navigation', 'jet-tabs' ),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => array(
'tab_scrolling_navigation' => 'yes',
'tab_scroll_type' => 'slider',
'tabs_position!' => ['left', 'right'],
'slider_show_nav' => 'yes',
),
)
);
$this->add_control(
'heading_arrows_style',
array(
'label' => esc_html__( 'Arrows', 'jet-tabs' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => array(
'tab_scrolling_navigation' => 'yes',
'tab_scroll_type' => 'slider',
'tabs_position!' => ['left', 'right'],
'slider_show_nav' => 'yes',
),
)
);
$this->add_responsive_control(
'arrows_size',
array(
'label' => __( 'Size', 'jet-tabs' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px' ],
'range' => array(
'px' => array(
'min' => 6,
'max' => 80,
),
),
'default' => array(
'unit' => 'px',
'size' => 24,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control_wrapper'] . ' .swiper-button-next:after, {{WRAPPER}} ' . $css_scheme['control_wrapper'] . ' .swiper-button-prev:after' => 'font-size: {{SIZE}}{{UNIT}};',
),
'condition' => array(
'tab_scrolling_navigation' => 'yes',
'tab_scroll_type' => 'slider',
'tabs_position!' => ['left', 'right'],
'slider_show_nav' => 'yes',
),
)
);
$this->add_control(
'arrows_position',
array(
'label' => esc_html__( 'Position', 'jet-tabs' ),
'type' => Controls_Manager::SELECT,
'default' => 'inside',
'options' => array(
'inside' => esc_html__( 'Inside', 'jet-tabs' ),
'outside' => esc_html__( 'Outside', 'jet-tabs' ),
),
'prefix_class' => 'jet-tabs-nav-position-',
'condition' => array(
'tab_scrolling_navigation' => 'yes',
'tab_scroll_type' => 'slider',
'tabs_position!' => ['left', 'right'],
'slider_show_nav' => 'yes',
),
)
);
$this->start_controls_tabs( 'tabs_arrows_colors' );
$this->start_controls_tab(
'tab_arrows_normal',
array(
'label' => __( 'Normal', 'jet-tabs' ),
)
);
$this->add_control(
'arrows_color',
array(
'label' => __( 'Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control_wrapper'] . ' .swiper-button-next, {{WRAPPER}} ' . $css_scheme['control_wrapper'] . ' .swiper-button-prev' => 'color: {{VALUE}};',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_arrows_hover',
array(
'label' => __( 'Hover', 'jet-tabs' ),
)
);
$this->add_control(
'arrows_color_hover',
array(
'label' => __( 'Color', 'jet-tabs' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control_wrapper'] . ' .swiper-button-next:hover, {{WRAPPER}} ' . $css_scheme['control_wrapper'] . ' .swiper-button-prev:hover' => 'color: {{VALUE}};',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
}
public function get_tab_item_content( $item = array(), $index = 0, $args = array() ) {
$tab_count = $index + 1;
$tab_content_setting_key = $this->get_repeater_setting_key( 'tab_content', 'tabs', $index );
$id_int = $args['id_int'];
$active_index = $args['active_index'];
$no_active_tabs = $args['no_active_tabs'];
$ajax_template = $args['ajax_template'];
$this->add_render_attribute( $tab_content_setting_key, array(
'id' => 'jet-tabs-content-' . $id_int . $tab_count,
'class' => array(
'jet-tabs__content',
( $index === $active_index && ! $no_active_tabs ) ? 'active-content' : '',
),
'data-tab' => $tab_count,
'role' => 'tabpanel',
'aria-hidden' => $index === $active_index ? 'false' : 'true',
'data-template-id' => ! empty( $item['item_template_id'] ) ? $item['item_template_id'] : 'false',
) );
$content_html = '';
$template_cache_settings = jet_tabs_settings()->get( 'useTemplateCache', [
'enable' => false,
'cacheExpiration' => 'week',
] );
$elementor_template = new Elementor_Template();
$in_elementor = jet_tabs_integration()->in_elementor();
switch ( $item[ 'content_type' ] ) {
case 'template':
if ( ! empty( $item['item_template_id'] ) ) {
$template_id = apply_filters( 'jet-tabs/widgets/template_id', $item['item_template_id'], $this );
$template_content = jet_tabs()->elementor()->frontend->get_builder_content_for_display( $template_id );
if ( ! empty( $template_content ) ) {
if ( ! $ajax_template ) {
if ( $template_cache_settings['enable'] && ! $in_elementor && is_array( $template_content ) ) {
$content_html .= $template_content['template_content'];
$template_styles = $template_content['template_styles'] ?? [];
$template_scripts = $template_content['template_scripts'] ?? [];
$this->styles_to_enqueue = wp_parse_args( $template_styles, $this->styles_to_enqueue );
$this->scripts_to_enqueue = wp_parse_args( $template_scripts, $this->scripts_to_enqueue );
} else {
$content_html .= is_array( $template_content ) ? ( $template_content['template_content'] ?? '' ) : $template_content;
}
} else {
$content_html .= '';
}
if ( jet_tabs_integration()->is_edit_mode() ) {
$link = add_query_arg(
array(
'elementor' => '',
),
get_permalink( $item['item_template_id'] )
);
$content_html .= sprintf( '%s
', $link, esc_html__( 'Edit Template', 'jet-tabs' ) );
}
} else {
$content_html = $this->no_template_content_message();
}
} else {
$content_html = $this->no_templates_message();
}
break;
case 'editor':
$content_html = $this->parse_text_editor( $item['item_editor_content'] );
break;
}
return sprintf( '%2$s
', $this->get_render_attribute_string( $tab_content_setting_key ), $content_html );
}
/**
* [render description]
* @return [type] [description]
*/
protected function render() {
$this->__context = 'render';
$tabs = $this->get_settings_for_display( 'tabs' );
$id_int = substr( $this->get_id_int(), 0, 3 );
$tabs_position = $this->get_settings( 'tabs_position' );
$tabs_position_tablet = $this->get_settings( 'tabs_position_tablet' );
$tabs_position_mobile = $this->get_settings( 'tabs_position_mobile' );
$show_effect = $this->get_settings( 'show_effect' );
$no_active_tabs = filter_var( $this->get_settings( 'no_active_tabs' ), FILTER_VALIDATE_BOOLEAN );
$ajax_template = filter_var( $this->get_settings( 'ajax_template' ), FILTER_VALIDATE_BOOLEAN );
$tabs_item_label_tag = ! empty( $this->get_settings( 'item_html_tag' ) ) ? $this->get_settings( 'item_html_tag' ) : 'div';
$tabs_scrolling_navigation = filter_var( $this->get_settings( 'tab_scrolling_navigation' ), FILTER_VALIDATE_BOOLEAN );
$tab_scroll_type = $this->get_settings( 'tab_scroll_type' );
$fixed_slide_width = filter_var( $this->get_settings( 'fixed_slide_width' ), FILTER_VALIDATE_BOOLEAN );
$slide_width_value = $this->get_settings( 'slide_width_value' );
$slider_centered = filter_var( $this->get_settings( 'slider_centered' ), FILTER_VALIDATE_BOOLEAN );
$slider_looped = filter_var( $this->get_settings( 'slider_looped' ), FILTER_VALIDATE_BOOLEAN );
$slider_show_nav = filter_var( $this->get_settings( 'slider_show_nav' ), FILTER_VALIDATE_BOOLEAN );
$tabs = apply_filters( 'jet-tabs/widget/loop-items', $tabs, 'tabs', $this );
if ( ! $tabs || empty( $tabs ) ) {
return false;
}
$active_index = -1;
foreach ( $tabs as $index => $item ) {
if ( ! is_array( $item ) ) {
continue;
}
// Find first active tab
if (
$active_index === -1 &&
array_key_exists( 'item_active', $item ) &&
filter_var( $item['item_active'], FILTER_VALIDATE_BOOLEAN )
) {
$active_index = $index;
}
if (
'template' === ( $item['content_type'] ?? '' ) &&
! empty( $item['item_template_id'] )
) {
$post_status = get_post_status( $item['item_template_id'] );
if ( 'draft' === $post_status || 'trash' === $post_status ) {
unset( $tabs[ $index ] );
}
}
}
if ( $active_index === -1 ) {
$active_index = 0;
}
$settings = array(
'activeIndex' => ! $no_active_tabs ? $active_index : -1,
'event' => $this->get_settings( 'tabs_event' ),
'autoSwitch' => filter_var( $this->get_settings( 'auto_switch' ), FILTER_VALIDATE_BOOLEAN ),
'autoSwitchDelay' => $this->get_settings( 'auto_switch_delay' ),
'ajaxTemplate' => $ajax_template,
'tabsPosition' => $tabs_position,
'switchScrolling' => filter_var( $this->get_settings( 'tab_control_switching' ), FILTER_VALIDATE_BOOLEAN ),
'switchScrollingOffset' => ! empty( $this->get_settings_for_display( 'tab_control_switching_offset' ) ) ? $this->get_settings_for_display( 'tab_control_switching_offset' ) : 0
);
$attributes = array(
'class' => array(
'jet-tabs',
'jet-tabs-position-' . $tabs_position,
'jet-tabs-' . $show_effect . '-effect',
( $ajax_template ) ? 'jet-tabs-ajax-template' : '',
),
'data-settings' => json_encode( $settings ),
);
if ( $tabs_scrolling_navigation && $tab_scroll_type === 'slider' && ( $tabs_position === 'top' || $tabs_position === 'bottom' ) ) {
$swiper_settings = array(
'slidesPerView' => $fixed_slide_width ? 'fixed' : 'auto',
'itemWidth' => $fixed_slide_width ? $slide_width_value['size'] . $slide_width_value['unit'] : 'auto',
'centeredSlides'=> $slider_centered,
'loop' => $slider_looped,
);
$attributes['data-swiper-settings'] = json_encode( $swiper_settings );
}
$this->add_render_attribute( 'instance', $attributes );
$tabs_content = array();
?>
get_render_attribute_string( 'instance' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>>
$tab ) {
echo $tab; // phpcs:ignore
}
?>
maybe_enqueue_styles();
$this->maybe_enqueue_scripts();
?>
' . esc_html__( 'You Haven’t Saved Templates Yet.', 'jet-tabs' ) . '
';
}
/**
* [no_templates_message description]
* @return [type] [description]
*/
public function no_templates_message() {
$message = '' . esc_html__( 'Template is not defined. ', 'jet-tabs' ) . '';
$link = add_query_arg(
array(
'post_type' => 'elementor_library',
'action' => 'elementor_new_post',
'_wpnonce' => wp_create_nonce( 'elementor_action_new_post' ),
'template_type' => 'section',
),
esc_url( admin_url( '/edit.php' ) )
);
$new_link = '' . esc_html__( 'Select an existing template or create a ', 'jet-tabs' ) . '' . esc_html__( 'new one', 'jet-tabs' ) . '' ;
return sprintf(
'%1$s%2$s
',
$message,
jet_tabs_integration()->in_elementor() ? $new_link : ''
);
}
/**
* [no_template_content_message description]
* @return [type] [description]
*/
public function no_template_content_message() {
$message = '' . esc_html__( 'The tabs are working. Please, note, that you have to add a template to the library in order to be able to display it inside the tabs.', 'jet-tabs' ) . '';
return sprintf( '%1$s
', $message );
}
/**
* [get_template_edit_link description]
* @param [type] $template_id [description]
* @return [type] [description]
*/
public function get_template_edit_link( $template_id ) {
$link = add_query_arg( 'elementor', '', get_permalink( $template_id ) );
return ' ' . esc_html__( 'Edit Template', 'jet-tabs' ) . '';
}
/**
* Get seconds by tag for transient caching
*
* @param string $tag Time duration tag
* @return string|int Returns 'none' or seconds
*/
public static function get_cache_timeout($tag = 'none') {
if ('none' === $tag) {
return 'none';
}
switch ($tag) {
case 'hour':
$delay = HOUR_IN_SECONDS;
break;
case 'day':
$delay = DAY_IN_SECONDS;
break;
case '3days':
$delay = 3 * DAY_IN_SECONDS;
break;
case 'week':
$delay = WEEK_IN_SECONDS;
break;
case 'month':
$delay = MONTH_IN_SECONDS;
break;
default:
$delay = 'none';
break;
}
return $delay;
}
/**
* @return false|void
*/
public function maybe_enqueue_styles() {
$style_depends = $this->get_styles_to_enqueue();
if ( empty( $style_depends ) ) {
return false;
}
foreach ( $style_depends as $key => $style_data ) {
$style_handle = $style_data['handle'];
if ( wp_style_is( $style_handle ) ) {
continue;
}
$style_obj = $style_data['obj'];
if ( $style_obj ) {
if ( ! isset( wp_styles()->registered[ $style_handle ] ) ) {
wp_styles()->registered[ $style_handle ] = $style_obj;
}
wp_enqueue_style( $style_obj->handle, $style_obj->src, $style_obj->deps, $style_obj->ver );
} else {
wp_enqueue_style( $style_handle, $style_data['src'] );
}
}
}
/**
* []
* @return [type] [description]
*/
public function maybe_enqueue_scripts() {
$script_depends = $this->get_scripts_to_enqueue();
if ( empty( $script_depends ) ) {
return false;
}
foreach ( $script_depends as $script => $script_data ) {
$script_handle = $script_data['handle'];
$script_obj = $script_data['obj'];
if ( wp_script_is( $script_handle ) ) {
continue;
}
wp_scripts()->registered[ $script_handle ] = $script_obj;
}
foreach ( $script_depends as $script => $script_data ) {
$script_handle = $script_data['handle'];
if ( wp_script_is( $script_handle ) ) {
continue;
}
$script_obj = $script_data['obj'];
wp_enqueue_script( $script_obj->handle, $script_obj->src, $script_obj->deps, $script_obj->ver );
wp_scripts()->print_extra_script( $script_obj->handle );
}
}
public function get_styles_to_enqueue() {
return $this->styles_to_enqueue;
}
/**
* Get script dependencies.
*
* Retrieve the list of script dependencies the element requires.
*
* @since 1.3.0
* @access public
*
* @return array Element scripts dependencies.
*/
public function get_scripts_to_enqueue() {
return $this->scripts_to_enqueue;
}
/**
* @var array
*/
public $styles_to_enqueue = [];
/**
* [$depended_scripts description]
* @var array
*/
public $scripts_to_enqueue = [];
}