File: //proc/self/cwd/wp-content/plugins/ftech-plugin/elementor/widgets/feature-section.php
<?php
/**
* Elementor Single Widget
* @package ftech Tools
* @since 1.0.0
*/
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
class Ftech_Feature 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-feature-';
}
/**
* Get widget title.
*
* Retrieve Elementor widget title.
*
* @since 1.0.0
* @access public
*
* @return string Widget title.
*/
public function get_title() {
return esc_html__( 'Feature', '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' ),
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'--service-option',
[
'label' => esc_html__( 'Feature Option', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$repeater = new \Elementor\Repeater();
$repeater->add_control(
'type',
[
'label' => __( 'Icon Type', 'gesto-core' ),
'type' => Controls_Manager::CHOOSE,
'label_block' => false,
'options' => [
'icon' => [
'title' => __( 'Icon', 'gesto-core' ),
'icon' => 'far fa-smile',
],
'image' => [
'title' => __( 'Image', 'gesto-core' ),
'icon' => 'fa fa-image',
],
],
'default' => 'icon',
'toggle' => false,
'style_transfer' => true,
]
);
$repeater->add_control(
'icon', [
'label' => esc_html__( 'Icon', 'gesto-plugin' ),
'type' => Controls_Manager::ICONS,
'label_block' => true,
'condition' => [
'type' => 'icon',
],
]
);
$repeater->add_control(
'icon_img', [
'label' => esc_html__( 'Icon Image', 'gesto-plugin' ),
'type' => Controls_Manager::MEDIA,
'label_block' => true,
'condition' => [
'type' => 'image',
],
]
);
$repeater->add_control(
'title', [
'label' => esc_html__( 'Title', 'gtbus-plugin' ),
'default' => esc_html__( 'market trends analysis', 'gtbus-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
]
);
$repeater->add_control(
'description', [
'label' => esc_html__( 'Description', 'gtbus-plugin' ),
'default' => esc_html__( 'We are web designers, developers, project managers digital', 'gtbus-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
]
);
$this->add_control(
'features',
[
'label' => esc_html__( 'Add Features Item', 'goyto-plugin' ),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ title }}}',
]
);
$this->end_controls_section();
$this->start_controls_section(
'--img-option',
[
'label' => esc_html__( 'Image Option', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'img_1', [
'label' => esc_html__( 'Image 1', 'gesto-plugin' ),
'type' => Controls_Manager::MEDIA,
'label_block' => true,
]
);
$this->add_control(
'img_2', [
'label' => esc_html__( 'Image 2', 'gesto-plugin' ),
'type' => Controls_Manager::MEDIA,
'label_block' => true,
]
);
$this->end_controls_section();
$this->start_controls_section(
'--service-right-option',
[
'label' => esc_html__( 'Feature Right Option', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$repeater = new \Elementor\Repeater();
$repeater->add_control(
'type',
[
'label' => __( 'Icon Type', 'gesto-core' ),
'type' => Controls_Manager::CHOOSE,
'label_block' => false,
'options' => [
'icon' => [
'title' => __( 'Icon', 'gesto-core' ),
'icon' => 'far fa-smile',
],
'image' => [
'title' => __( 'Image', 'gesto-core' ),
'icon' => 'fa fa-image',
],
],
'default' => 'icon',
'toggle' => false,
'style_transfer' => true,
]
);
$repeater->add_control(
'icon', [
'label' => esc_html__( 'Icon', 'gesto-plugin' ),
'type' => Controls_Manager::ICONS,
'label_block' => true,
'condition' => [
'type' => 'icon',
],
]
);
$repeater->add_control(
'icon_img', [
'label' => esc_html__( 'Icon Image', 'gesto-plugin' ),
'type' => Controls_Manager::MEDIA,
'label_block' => true,
'condition' => [
'type' => 'image',
],
]
);
$repeater->add_control(
'title', [
'label' => esc_html__( 'Title', 'gtbus-plugin' ),
'default' => esc_html__( 'market trends analysis', 'gtbus-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
]
);
$repeater->add_control(
'description', [
'label' => esc_html__( 'Description', 'gtbus-plugin' ),
'default' => esc_html__( 'We are web designers, developers, project managers digital', 'gtbus-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
]
);
$this->add_control(
'features_right',
[
'label' => esc_html__( 'Add Features Item', 'goyto-plugin' ),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ title }}}',
]
);
$this->end_controls_section();
$this->start_controls_section(
'slider_setting',
[
'label' => esc_html__( 'Slider Setting Option', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'pagination_hide',
[
'label' => esc_html__( 'Service Pagination Hide', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Show', 'ftech-plugin' ),
'label_off' => esc_html__( 'Hide', 'ftech-plugin' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
$this->end_controls_section();
// Sub title style
$this->start_controls_section(
'icon_style',
[
'label' => esc_html__( 'Service Icon Style', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'sb_margin',
[
'label' => esc_html__( 'Sub Title Margin', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ftc-campaign-1-card .card-title .icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'icon_color',
[
'label' => esc_html__( 'Sub Title Color', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .ftc-campaign-1-card .card-title .icon' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'icon-size',
[
'label' => esc_html__( 'Icon Size', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::SLIDER,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ftc-campaign-1-card .card-title .icon' => 'font-size: {{SIZE}}{{UNIT}};',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'slider_sub_title_style',
[
'label' => esc_html__( 'Title Style', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'margin',
[
'label' => esc_html__( 'Title Margin', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ftc-campaign-1-card .card-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Sub Title Color', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .ftc-campaign-1-card .card-title' => 'color: {{VALUE}}',
],
]
);
// typography
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'm_s_typography',
'selector' => '{{WRAPPER}} .ftc-campaign-1-card .card-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-campaign-1-card .card-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-campaign-1-card .card-disc' => 'color: {{VALUE}}',
],
]
);
// typography
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'm_desc_typography',
'selector' => '{{WRAPPER}} .ftc-campaign-1-card .card-disc',
]
);
$this->end_controls_section();
// title style
$this->start_controls_section(
'--box-style--',
[
'label' => esc_html__( 'Box Style', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'box_margin',
[
'label' => esc_html__( 'Box Margin', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ftc-campaign-1-card' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'box_padding',
[
'label' => esc_html__( 'Box Padding', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ftc-campaign-1-card' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'box_bg_color',
[
'label' => esc_html__( 'Box Background Color', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .ftc-campaign-1-card' => 'background-color: {{VALUE}}',
],
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
require __DIR__ . '/view/feature/feature-' . $settings['style'] . '.php';
}
}
Plugin::instance()->widgets_manager->register( new Ftech_Feature() );