File: /var/www/html/wpprotonperinggit/wp-content/themes/voiture/inc/vendors/elementor/widgets/team.php
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class Voiture_Elementor_Team extends Widget_Base {
public function get_name() {
return 'apus_element_team';
}
public function get_title() {
return esc_html__( 'Apus Teams', 'voiture' );
}
public function get_icon() {
return 'fa fa-users';
}
public function get_categories() {
return [ 'voiture-elements' ];
}
protected function register_controls() {
$this->start_controls_section(
'content_section',
[
'label' => esc_html__( 'Team', 'voiture' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$repeater = new Repeater();
$repeater->add_control(
'title', [
'label' => esc_html__( 'Social Title', 'voiture' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Social Title' , 'voiture' ),
'label_block' => true,
]
);
$repeater->add_control(
'link',
[
'label' => esc_html__( 'Social Link', 'voiture' ),
'type' => Controls_Manager::TEXT,
'input_type' => 'url',
'placeholder' => esc_html__( 'Enter your social link here', 'voiture' ),
]
);
$repeater->add_control(
'icon',
[
'label' => esc_html__( 'Social Icon', 'voiture' ),
'type' => Controls_Manager::ICON,
'default' => 'fa fa-star',
]
);
$this->add_control(
'name', [
'label' => esc_html__( 'Name', 'voiture' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Member Name' , 'voiture' ),
'label_block' => true,
]
);
$this->add_control(
'listing', [
'label' => esc_html__( 'Job', 'voiture' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Member Listing' , 'voiture' ),
'label_block' => true,
]
);
$this->add_control(
'img_src',
[
'name' => 'image',
'label' => esc_html__( 'Image', 'voiture' ),
'type' => Controls_Manager::MEDIA,
'placeholder' => esc_html__( 'Upload Image Here', 'voiture' ),
]
);
$this->add_control(
'description', [
'label' => esc_html__( 'Description', 'voiture' ),
'type' => Controls_Manager::TEXTAREA,
'default' => esc_html__( 'Member Description' , 'voiture' ),
'label_block' => true,
]
);
$this->add_control(
'socials',
[
'label' => esc_html__( 'Socials', 'voiture' ),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
]
);
$this->add_control(
'el_class',
[
'label' => esc_html__( 'Extra class name', 'voiture' ),
'type' => Controls_Manager::TEXT,
'placeholder' => esc_html__( 'If you wish to style particular content element differently, please add a class name to this field and refer to it in your custom CSS file.', 'voiture' ),
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_title_style',
[
'label' => esc_html__( 'Title', 'voiture' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Background Hover Color', 'voiture' ),
'type' => Controls_Manager::COLOR,
'scheme' => [
'type' => Core\Schemes\Color::get_type(),
'value' => Core\Schemes\Color::COLOR_1,
],
'selectors' => [
// Stronger selector to avoid section style from overwriting
'{{WRAPPER}} .social a:hover' => 'background-color: {{VALUE}};',
],
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings();
extract( $settings );
?>
<div class="widget-team <?php echo esc_attr($el_class); ?>">
<?php
if ( !empty($settings['img_src']['id']) ) {
?>
<div class="team-image">
<?php echo voiture_get_attachment_thumbnail($settings['img_src']['id'], 'full'); ?>
</div>
<?php } ?>
<div class="content">
<?php if ( !empty($socials) ) { ?>
<ul class="social">
<?php foreach ($socials as $social) { ?>
<?php if ( !empty($social['link']) && !empty($social['icon']) ) { ?>
<li>
<a class="<?php echo esc_attr(explode(' ',$social['icon'])[1]); ?>" href="<?php echo esc_url($social['link']);?>" <?php echo esc_html(!empty($social['title']) ? 'title="'.$social['title'].'"' : ''); ?>>
<i class="<?php echo esc_attr($social['icon']); ?>"></i>
</a>
</li>
<?php } ?>
<?php } ?>
</ul>
<?php } ?>
<?php if ( !empty($name) ) { ?>
<h3 class="name-team"><?php echo esc_html($name); ?></h3>
<?php } ?>
<?php if ( !empty($listing) ) { ?>
<div class="listing"><?php echo esc_html($listing); ?></div>
<?php } ?>
</div>
</div>
<?php
}
}
if ( version_compare(ELEMENTOR_VERSION, '3.5.0', '<') ) {
Plugin::instance()->widgets_manager->register_widget_type( new Voiture_Elementor_Team );
} else {
Plugin::instance()->widgets_manager->register( new Voiture_Elementor_Team );
}