Your IP : 216.73.216.0
<?php
namespace Layerdrops\Zeinet\Widgets;
class Team extends \Elementor\Widget_Base
{
public function get_name()
{
return 'zeinet-team';
}
public function get_title()
{
return __('Team', 'zeinet-addon');
}
public function get_icon()
{
return 'eicon-cogs';
}
public function get_categories()
{
return ['zeinet-category'];
}
protected function register_controls()
{
$this->start_controls_section(
'layout_section',
[
'label' => __('Layout', 'zeinet-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'layout_type',
[
'label' => __('Select Layout', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::SELECT2,
'default' => 'layout_one',
'options' => [
'layout_one' => __('Layout One', 'zeinet-addon'),
'layout_two' => __('Layout Two', 'zeinet-addon'),
'layout_three' => __('Layout Three', 'zeinet-addon'),
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_content',
[
'label' => __('Content', 'zeinet-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => ['layout_one', 'layout_two', 'layout_three']
]
]
);
$this->add_control(
'sec_title',
[
'label' => __('Section Title', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'placeholder' => __('Add Title', 'zeinet-addon'),
'default' => __('Default Title', 'zeinet-addon'),
'condition' => [
'layout_type' => 'layout_one'
]
]
);
$this->add_control(
'sec_sub_title',
[
'label' => __('Section Sub Title', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'placeholder' => __('Add Sub Title', 'zeinet-addon'),
'default' => __('Default Title', 'zeinet-addon'),
'condition' => [
'layout_type' => 'layout_one'
]
]
);
$team = new \Elementor\Repeater();
$team->add_control(
'name',
[
'label' => __('Name', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Mike Hardson', 'zeinet-addon'),
'label_block' => true,
]
);
$team->add_control(
'url',
[
'label' => __('Url', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::URL,
'placeholder' => __('#', 'zeinet-addon'),
'show_external' => false,
'default' => [
'url' => '#',
'is_external' => false,
'nofollow' => true,
],
'show_label' => false,
]
);
$team->add_control(
'designation',
[
'label' => __('Designation', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'label_block' => true,
'default' => __('Director', 'zeinet-addon'),
]
);
$team->add_control(
'social_network',
[
'label' => __('Social NetWork', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::CODE,
'label_block' => true,
'default' => wp_kses('<li><a href="#"><i class="fab fa-twitter"></i></a></li>', 'zeinet_allowed_tags')
]
);
$team->add_control(
'image',
[
'label' => __('Image', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [
'url' => \Elementor\Utils::get_placeholder_image_src(),
],
]
);
$this->add_control(
'team_items',
[
'label' => __('Team', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $team->get_controls(),
'prevent_empty' => false,
'title_field' => '{{{ name }}}',
]
);
$this->end_controls_section();
//General style
$this->start_controls_section(
'general_style',
[
'label' => esc_html__('Style Options', 'zeinet-addon'),
'tab' => \Elementor\Controls_Manager::TAB_STYLE,
]
);
zeinet_typo_and_color_options($this, 'Section Title', '{{WRAPPER}} .section-title__title', ['layout_one']);
zeinet_typo_and_color_options($this, 'Section Sub Title', '{{WRAPPER}} .section-title__tagline', ['layout_one']);
zeinet_typo_and_color_options($this, 'Name', '{{WRAPPER}} .team-one__name a', ['layout_one', 'layout_two', 'layout_three']);
zeinet_typo_and_color_options($this, 'Designation', '{{WRAPPER}} .team-one__sub-title', ['layout_one', 'layout_two', 'layout_three']);
$this->end_controls_section();
zeinet_get_elementor_carousel_options($this, ['layout_three']);
}
protected function render()
{
$settings = $this->get_settings_for_display();
include zeinet_get_template('team-one.php');
include zeinet_get_template('team-two.php');
include zeinet_get_template('team-three.php');
}
}