File: //proc/self/cwd/wp-content/plugins/ftech-plugin/elementor/widgets/ftech-tab.php
<?php
/**
* Elementor Single Widget
* @package ftech Tools
* @since 1.0.0
*/
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
class Ftech_Tabs extends Widget_Base {
/**
* Get widget name.
*
* Retrieve Elementor widget name.
*
* @since 1.0.0
* @access public
*
* @return string Widget name.
*/
public function get_name() {
return 'go-tabs-';
}
/**
* Get widget title.
*
* Retrieve Elementor widget title.
*
* @since 1.0.0
* @access public
*
* @return string Widget title.
*/
public function get_title() {
return esc_html__( 'Ftech Tab', 'ftech-plugin' );
}
/**
* Get widget icon.
*
* Retrieve Elementor widget icon.
*
* @since 1.0.0
* @access public
*
* @return string Widget icon.
*/
public function get_icon() {
return 'ftech-custom-icon';
}
/**
* Get widget categories.
*
* Retrieve the list of categories the Elementor widget belongs to.
*
* @since 1.0.0
* @access public
*
* @return array Widget categories.
*/
public function get_categories() {
return [ 'ftech_widgets' ];
}
protected function register_controls() {
$this->start_controls_section(
'int_widget_opt',
[
'label' => esc_html__( 'Feature Select', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'style',
[
'label' => esc_html__( 'Style', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => '1',
'options' => [
'1' => esc_html__( 'Style 1', 'ftech-plugin' ),
'2' => esc_html__( 'Style 2', 'ftech-plugin' ),
'3' => esc_html__( 'Style 3', 'ftech-plugin' ),
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'--service-option',
[
'label' => esc_html__( 'Tab Option', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'img_1', [
'label' => esc_html__( 'Image 1', 'ftech-plugin' ),
'type' => Controls_Manager::MEDIA,
'label_block' => true,
'condition' => [
'style' => '2',
],
]
);
$this->add_control(
'img_2', [
'label' => esc_html__( 'Image 2', 'ftech-plugin' ),
'type' => Controls_Manager::MEDIA,
'label_block' => true,
'condition' => [
'style' => '2',
],
]
);
$repeater = new \Elementor\Repeater();
$repeater->add_control(
'layout',
[
'label' => esc_html__( 'Display Field', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => '1',
'options' => [
'1' => esc_html__( 'Style 1', 'ftech-plugin' ),
'2' => esc_html__( 'Style 2', 'ftech-plugin' ),
'3' => esc_html__( 'Style 3', 'ftech-plugin' ),
]
]
);
$repeater->add_control(
'img_1', [
'label' => esc_html__( 'Image 1', 'ftech-plugin' ),
'type' => Controls_Manager::MEDIA,
'label_block' => true,
'condition' => [
'layout' => ['1', '2'],
],
]
);
$repeater->add_control(
'img_2', [
'label' => esc_html__( 'Image 2', 'ftech-plugin' ),
'type' => Controls_Manager::MEDIA,
'label_block' => true,
'condition' => [
'layout' => '1',
],
]
);
$repeater->add_control(
'tab_title_count', [
'label' => esc_html__( 'Tab Title Count', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'condition' => [
'layout' => '1',
],
]
);
$repeater->add_control(
'tab_title', [
'label' => esc_html__( 'Tab Title', 'ftech-plugin' ),
'default' => esc_html__( 'Trademark Search', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
]
);
$repeater->add_control(
'title', [
'label' => esc_html__( 'Title', 'ftech-plugin' ),
'default' => esc_html__( 'market trends analysis', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'condition' => [
'layout' => ['1', '2'],
],
]
);
$repeater->add_control(
'description', [
'label' => esc_html__( 'Description', 'ftech-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
]
);
$repeater->add_control(
'count', [
'label' => esc_html__( 'Count', 'ftech-plugin' ),
'default' => esc_html__( '500', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'condition' => [
'layout' => '1',
],
]
);
$repeater->add_control(
'prefix', [
'label' => esc_html__( 'Prefix', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'condition' => [
'layout' => '1',
],
]
);
$repeater->add_control(
'count_title', [
'label' => esc_html__( 'Counter Title', 'ftech-plugin' ),
'default' => esc_html__( 'Created Projects', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'condition' => [
'layout' => '1',
],
]
);
$repeater->add_control(
'btn_label', [
'label' => esc_html__( 'Button Label', 'ftech-plugin' ),
'default' => esc_html__( 'ftech Button', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'condition' => [
'layout' => ['1', '2'],
],
]
);
$repeater->add_control(
'btn_link', [
'label' => esc_html__( 'Button Link', 'ftech-plugin' ),
'type' => Controls_Manager::URL,
'default' => [
'url' => '',
'is_external' => true,
'nofollow' => true,
// 'custom_attributes' => '',
],
'label_block' => true,
'condition' => [
'layout' => ['1', '2'],
],
]
);
$this->add_control(
'tabs',
[
'label' => esc_html__( 'Add Tabs Item', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ tab_title }}}',
]
);
$this->add_control(
'btn_label', [
'label' => esc_html__( 'Button Label', 'ftech-plugin' ),
'default' => esc_html__( 'ftech Button', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'condition' => [
'style' => ['3'],
],
]
);
$this->add_control(
'btn_link', [
'label' => esc_html__( 'Button Link', 'ftech-plugin' ),
'type' => Controls_Manager::URL,
'default' => [
'url' => '',
'is_external' => true,
'nofollow' => true,
// 'custom_attributes' => '',
],
'label_block' => true,
'condition' => [
'style' => ['3'],
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'--tab-title-style-',
[
'label' => esc_html__( 'Tab Title Style', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'tab_title_color',
[
'label' => esc_html__( 'Tab Title Color', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .ftc-heading-1:is(.has-color-white)' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'tab_active_title_color',
[
'label' => esc_html__( 'Tab Active Title Color', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .ftc-special-1-tabs-btn .nav-item .nav-link:is(.active)' => 'color: {{VALUE}}',
],
]
);
// typography
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'tab_title_typography',
'selector' => '{{WRAPPER}} .ftc-special-1-tabs-btn .nav-item .nav-link',
]
);
$this->end_controls_section();
$this->start_controls_section(
'---title-style-',
[
'label' => esc_html__( 'Title Style', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Title Color', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .ftc-special-1-tabs-content .item-title' => 'color: {{VALUE}}',
],
]
);
// typography
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'selector' => '{{WRAPPER}} .ftc-special-1-tabs-content .item-title',
]
);
$this->end_controls_section();
$this->start_controls_section(
'slider_desc_style',
[
'label' => esc_html__( 'Desc Style', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'desc_margin',
[
'label' => esc_html__( 'Desc Margin', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ftc-special-1-tabs-content .item-disc' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'desc_color',
[
'label' => esc_html__( 'Desc Color', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .ftc-special-1-tabs-content .item-disc' => 'color: {{VALUE}}',
],
]
);
// typography
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'm_desc_typography',
'selector' => '{{WRAPPER}} .ftc-special-1-tabs-content .item-disc',
]
);
$this->end_controls_section();
// feature style
$this->start_controls_section(
'slider_button_one',
[
'label' => esc_html__( 'Button Style', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'm_b_typography',
'selector' => '{{WRAPPER}} .ftc-btn-1',
]
);
$this->add_control(
'padding',
[
'label' => esc_html__( 'Padding', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ftc-btn-1' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'b_round',
[
'label' => esc_html__( 'Border Radius', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ftc-btn-1' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->start_controls_tabs(
'style_tabs'
);
$this->start_controls_tab(
'style_normal_tab',
[
'label' => esc_html__( 'Normal', 'ftech-plugin' ),
]
);
$this->add_control(
'btn_text',
[
'label' => esc_html__( 'Text Color', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .ftc-btn-1' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
\Elementor\Group_Control_Background::get_type(),
[
'name' => 'button_bg_color',
'types' => [ 'gradient' ],
'exclude' => [ 'image' ],
'selector' => '{{WRAPPER}} .ftc-btn-1',
'fields_options' => [
'background' => [
'label' => esc_html__( 'Button BG Color ', 'ftech-plugin' ),
'description' => esc_html__( 'Choose background type and style.', 'ftech-plugin' ),
'separator' => 'before',
]
]
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'style_hover_tab',
[
'label' => esc_html__( 'Hover', 'ftech-plugin' ),
]
);
$this->add_group_control(
\Elementor\Group_Control_Background::get_type(),
[
'name' => 'button_bg_hover_color',
'types' => [ 'gradient' ],
'exclude' => [ 'image' ],
'selector' => '{{WRAPPER}} .ftc-btn-1:before',
'fields_options' => [
'background' => [
'label' => esc_html__( 'Button Hover BG Color ', 'ftech-plugin' ),
'description' => esc_html__( 'Choose background type and style.', 'ftech-plugin' ),
'separator' => 'before',
]
]
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
require __DIR__ . '/view/ftech-tab/tab-' . $settings['style'] . '.php';
}
}
Plugin::instance()->widgets_manager->register( new Ftech_Tabs() );