Current File : /home/kelaby89/diamondtiptiling.com/wp-content/plugins/floens-addon/includes/Widgets/Sponsors.php |
<?php
namespace Layerdrops\Floens\Widgets;
class Sponsors extends \Elementor\Widget_Base
{
public function get_name()
{
return 'floens-sponsors';
}
public function get_title()
{
return __('Sponsors', 'floens-addon');
}
public function get_icon()
{
return 'eicon-cogs';
}
public function get_categories()
{
return ['floens-category'];
}
protected function register_controls()
{
$this->start_controls_section(
'layout_section',
[
'label' => __('Layout', 'floens-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'layout_type',
[
'label' => __('Select Layout', 'floens-addon'),
'type' => \Elementor\Controls_Manager::SELECT2,
'default' => 'layout_one',
'options' => [
'layout_one' => __('Layout One', 'floens-addon'),
'layout_two' => __('Layout Two', 'floens-addon'),
'layout_three' => __('Layout Three', 'floens-addon')
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'content_section',
[
'label' => __('Content', 'floens-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'sec_title',
[
'label' => __('Section Title', 'floens-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'placeholder' => __('Add title', 'floens-addon'),
'default' => __('Default Title', 'floens-addon'),
'condition' => [
'layout_type' => 'layout_one'
]
]
);
$sponsor_images = new \Elementor\Repeater();
$sponsor_images->add_control(
'image',
[
'label' => __('Add Image', 'floens-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
]
);
$this->add_control(
'sponsor_images',
[
'label' => __('Sponsor Items', 'floens-addon'),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $sponsor_images->get_controls(),
'condition' => [
'layout_type' => ['layout_one', 'layout_two']
]
]
);
$sponsor_images = new \Elementor\Repeater();
$sponsor_images->add_control(
'image',
[
'label' => __('Add Image One', 'floens-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
]
);
$sponsor_images->add_control(
'image_two',
[
'label' => __('Add Image Two', 'floens-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
]
);
$this->add_control(
'sponsor_images_two',
[
'label' => __('Sponsor Items', 'floens-addon'),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $sponsor_images->get_controls(),
'condition' => [
'layout_type' => ['layout_three']
]
]
);
$this->end_controls_section();
//General style
$this->start_controls_section(
'general_style',
[
'label' => esc_html__('Content Style', 'floens-addon'),
'tab' => \Elementor\Controls_Manager::TAB_STYLE,
]
);
floens_elementor_general_style_options($this, 'Section Title', '{{WRAPPER}} .client-carousel__tilte span', ['layout_one', 'layout_two', 'layout_three']);
$this->end_controls_section();
floens_get_elementor_carousel_options($this, ['layout_one', 'layout_two', 'layout_three']);
}
protected function render()
{
$settings = $this->get_settings_for_display();
include floens_get_template('sponsors-one.php');
include floens_get_template('sponsors-two.php');
include floens_get_template('sponsors-three.php');
}
}