Current Path : /storage/v11800/lifespanstoresnew/public_html/wp-content/plugins/suxnix-core/include/elementor/ |
Linux v11800 5.3.0-1023-aws #25~18.04.1-Ubuntu SMP Fri Jun 5 15:19:18 UTC 2020 aarch64
|
Current File : /storage/v11800/lifespanstoresnew/public_html/wp-content/plugins/suxnix-core/include/elementor/team.php |
<?php
namespace TPCore\Widgets;
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use \Elementor\Group_Control_Background;
use \Elementor\Group_Control_Image_Size;
use \Elementor\Repeater;
use \Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Suxnix Core
*
* Elementor widget for hello world.
*
* @since 1.0.0
*/
class TP_Team extends Widget_Base {
/**
* Retrieve the widget name.
*
* @since 1.0.0
*
* @access public
*
* @return string Widget name.
*/
public function get_name() {
return 'tp-team';
}
/**
* Retrieve the widget title.
*
* @since 1.0.0
*
* @access public
*
* @return string Widget title.
*/
public function get_title() {
return __( 'Team', 'tpcore' );
}
/**
* Retrieve the widget icon.
*
* @since 1.0.0
*
* @access public
*
* @return string Widget icon.
*/
public function get_icon() {
return 'tp-icon';
}
/**
* Retrieve the list of categories the widget belongs to.
*
* Used to determine where to display the widget in the editor.
*
* Note that currently Elementor supports only one category.
* When multiple categories passed, Elementor uses the first one.
*
* @since 1.0.0
*
* @access public
*
* @return array Widget categories.
*/
public function get_categories() {
return [ 'tpcore' ];
}
/**
* Retrieve the list of scripts the widget depended on.
*
* Used to set scripts dependencies required to run the widget.
*
* @since 1.0.0
*
* @access public
*
* @return array Widget scripts dependencies.
*/
public function get_script_depends() {
return [ 'tpcore' ];
}
/**
* Register the widget controls.
*
* Adds different input fields to allow the user to change and customize the widget settings.
*
* @since 1.0.0
*
* @access protected
*/
protected function register_controls() {
// layout Panel
$this->start_controls_section(
'tp_layout',
[
'label' => esc_html__('Design Layout', 'tpcore'),
]
);
$this->add_control(
'tp_design_style',
[
'label' => esc_html__('Select Layout', 'tpcore'),
'type' => Controls_Manager::SELECT,
'options' => [
'layout-1' => esc_html__('Layout 1', 'tpcore'),
'layout-2' => esc_html__('Layout 2', 'tpcore'),
],
'default' => 'layout-1',
]
);
$this->end_controls_section();
// member list
$this->start_controls_section(
'_section_teams',
[
'label' => __( 'Members', 'tpcore' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$repeater = new Repeater();
$repeater->start_controls_tabs(
'_tab_style_member_box_itemr'
);
$repeater->start_controls_tab(
'_tab_member_info',
[
'label' => __( 'Information', 'tpcore' ),
]
);
$repeater->add_control(
'image',
[
'type' => Controls_Manager::MEDIA,
'label' => __( 'Image', 'tpcore' ),
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'title',
[
'type' => Controls_Manager::TEXT,
'label_block' => true,
'label' => __( 'Title', 'tpcore' ),
'default' => __( 'Morgan Cooper', 'tpcore' ),
'placeholder' => __( 'Type title here', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'designation',
[
'type' => Controls_Manager::TEXT,
'label_block' => true,
'show_label' => true,
'label' => __( 'Designation', 'tpcore' ),
'default' => __( 'Co-founder', 'tpcore' ),
'placeholder' => __( 'Type designation here', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->end_controls_tab();
$repeater->start_controls_tab(
'_tab_member_links',
[
'label' => __( 'Links', 'tpcore' ),
]
);
$repeater->add_control(
'show_social',
[
'label' => __( 'Show Options?', 'tpcore' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Yes', 'tpcore' ),
'label_off' => __( 'No', 'tpcore' ),
'return_value' => 'yes',
'style_transfer' => true,
]
);
$repeater->add_control(
'web_title',
[
'type' => Controls_Manager::TEXT,
'label_block' => false,
'label' => __( 'Website Address', 'tpcore' ),
'placeholder' => __( 'Add your profile link', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'email_title',
[
'type' => Controls_Manager::TEXT,
'label_block' => false,
'label' => __( 'Email', 'tpcore' ),
'placeholder' => __( 'Add your email link', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'phone_title',
[
'type' => Controls_Manager::TEXT,
'label_block' => false,
'label' => __( 'Phone', 'tpcore' ),
'placeholder' => __( 'Add your phone link', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'facebook_title',
[
'type' => Controls_Manager::TEXT,
'label_block' => false,
'label' => __( 'Facebook', 'tpcore' ),
'default' => __( '#', 'tpcore' ),
'placeholder' => __( 'Add your facebook link', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'twitter_title',
[
'type' => Controls_Manager::TEXT,
'label_block' => false,
'label' => __( 'Twitter', 'tpcore' ),
'default' => __( '#', 'tpcore' ),
'placeholder' => __( 'Add your twitter link', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'instagram_title',
[
'type' => Controls_Manager::TEXT,
'label_block' => false,
'label' => __( 'Instagram', 'tpcore' ),
'default' => __( '#', 'tpcore' ),
'placeholder' => __( 'Add your instagram link', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'linkedin_title',
[
'type' => Controls_Manager::TEXT,
'label_block' => false,
'label' => __( 'LinkedIn', 'tpcore' ),
'placeholder' => __( 'Add your linkedin link', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'youtube_title',
[
'type' => Controls_Manager::TEXT,
'label_block' => false,
'label' => __( 'Youtube', 'tpcore' ),
'placeholder' => __( 'Add your youtube link', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'googleplus_title',
[
'type' => Controls_Manager::TEXT,
'label_block' => false,
'label' => __( 'Google Plus', 'tpcore' ),
'placeholder' => __( 'Add your Google Plus link', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'flickr_title',
[
'type' => Controls_Manager::TEXT,
'label_block' => false,
'label' => __( 'Flickr', 'tpcore' ),
'placeholder' => __( 'Add your flickr link', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'vimeo_title',
[
'type' => Controls_Manager::TEXT,
'label_block' => false,
'label' => __( 'Vimeo', 'tpcore' ),
'placeholder' => __( 'Add your vimeo link', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'behance_title',
[
'type' => Controls_Manager::TEXT,
'label_block' => false,
'label' => __( 'Behance', 'tpcore' ),
'placeholder' => __( 'Add your hehance link', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'dribble_title',
[
'type' => Controls_Manager::TEXT,
'label_block' => false,
'label' => __( 'Dribbble', 'tpcore' ),
'placeholder' => __( 'Add your dribbble link', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'pinterest_title',
[
'type' => Controls_Manager::TEXT,
'label_block' => false,
'label' => __( 'Pinterest', 'tpcore' ),
'placeholder' => __( 'Add your pinterest link', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->add_control(
'gitub_title',
[
'type' => Controls_Manager::TEXT,
'label_block' => false,
'label' => __( 'Github', 'tpcore' ),
'placeholder' => __( 'Add your github link', 'tpcore' ),
'dynamic' => [
'active' => true,
]
]
);
$repeater->end_controls_tab();
$repeater->end_controls_tabs();
// REPEATER
$this->add_control(
'teams',
[
'show_label' => false,
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '<# print(title || "Carousel Item"); #>',
'default' => [
[
'image' => [
'url' => Utils::get_placeholder_image_src(),
],
],
[
'image' => [
'url' => Utils::get_placeholder_image_src(),
],
],
[
'image' => [
'url' => Utils::get_placeholder_image_src(),
],
],
[
'image' => [
'url' => Utils::get_placeholder_image_src(),
],
],
[
'image' => [
'url' => Utils::get_placeholder_image_src(),
],
]
]
]
);
$this->add_group_control(
Group_Control_Image_Size::get_type(),
[
'name' => 'thumbnail',
'default' => 'medium_large',
'separator' => 'before',
'exclude' => [
'custom'
]
]
);
$this->add_control(
'title_tag',
[
'label' => __( 'Title HTML Tag', 'tpcore' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'h1' => [
'title' => __( 'H1', 'tpcore' ),
'icon' => 'eicon-editor-h1'
],
'h2' => [
'title' => __( 'H2', 'tpcore' ),
'icon' => 'eicon-editor-h2'
],
'h3' => [
'title' => __( 'H3', 'tpcore' ),
'icon' => 'eicon-editor-h3'
],
'h4' => [
'title' => __( 'H4', 'tpcore' ),
'icon' => 'eicon-editor-h4'
],
'h5' => [
'title' => __( 'H5', 'tpcore' ),
'icon' => 'eicon-editor-h5'
],
'h6' => [
'title' => __( 'H6', 'tpcore' ),
'icon' => 'eicon-editor-h6'
]
],
'default' => 'h3',
'toggle' => false,
]
);
$this->add_responsive_control(
'align',
[
'label' => __( 'Alignment', 'tpcore' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __( 'Left', 'tpcore' ),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => __( 'Center', 'tpcore' ),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => __( 'Right', 'tpcore' ),
'icon' => 'eicon-text-align-right',
],
],
'toggle' => true,
'selectors' => [
'{{WRAPPER}} .single-carousel-item' => 'text-align: {{VALUE}};'
]
]
);
$this->end_controls_section();
// tg_btn_button_group
$this->start_controls_section(
'tg_btn_button_group',
[
'label' => esc_html__('Button', 'tpcore'),
]
);
$this->add_control(
'tg_btn_button_show',
[
'label' => esc_html__( 'Show Button', 'tpcore' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Show', 'tpcore' ),
'label_off' => esc_html__( 'Hide', 'tpcore' ),
'return_value' => 'yes',
'default' => true,
]
);
$this->add_control(
'tg_btn_text',
[
'label' => esc_html__('Button Text', 'tpcore'),
'type' => Controls_Manager::TEXT,
'default' => esc_html__('Join our team', 'tpcore'),
'title' => esc_html__('Enter button text', 'tpcore'),
'label_block' => true,
'condition' => [
'tg_btn_button_show' => 'yes'
],
]
);
$this->add_control(
'tg_btn_link_type',
[
'label' => esc_html__('Button Link Type', 'tpcore'),
'type' => Controls_Manager::SELECT,
'options' => [
'1' => 'Custom Link',
'2' => 'Internal Page',
],
'default' => '1',
'label_block' => true,
'condition' => [
'tg_btn_button_show' => 'yes'
],
]
);
$this->add_control(
'tg_btn_link',
[
'label' => esc_html__('Button link', 'tpcore'),
'type' => Controls_Manager::URL,
'dynamic' => [
'active' => true,
],
'placeholder' => esc_html__('https://your-link.com', 'tpcore'),
'show_external' => false,
'default' => [
'url' => '#',
'is_external' => true,
'nofollow' => true,
'custom_attributes' => '',
],
'condition' => [
'tg_btn_link_type' => '1',
'tg_btn_button_show' => 'yes'
],
'label_block' => true,
]
);
$this->add_control(
'tg_btn_page_link',
[
'label' => esc_html__('Select Button Page', 'tpcore'),
'type' => Controls_Manager::SELECT2,
'label_block' => true,
'options' => tp_get_all_pages(),
'condition' => [
'tg_btn_link_type' => '2',
'tg_btn_button_show' => 'yes'
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_style',
[
'label' => __( 'Style', 'tpcore' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'text_transform',
[
'label' => __( 'Text Transform', 'tpcore' ),
'type' => Controls_Manager::SELECT,
'default' => '',
'options' => [
'' => __( 'None', 'tpcore' ),
'uppercase' => __( 'UPPERCASE', 'tpcore' ),
'lowercase' => __( 'lowercase', 'tpcore' ),
'capitalize' => __( 'Capitalize', 'tpcore' ),
],
'selectors' => [
'{{WRAPPER}} .title' => 'text-transform: {{VALUE}};',
],
]
);
$this->end_controls_section();
}
/**
* Render the widget output on the frontend.
*
* Written in PHP and used to generate the final HTML.
*
* @since 1.0.0
*
* @access protected
*/
protected function render() {
$settings = $this->get_settings_for_display();
// Link
if ('2' == $settings['tg_btn_link_type']) {
$this->add_render_attribute('tg-button-arg', 'href', get_permalink($settings['tg_btn_page_link']));
$this->add_render_attribute('tg-button-arg', 'target', '_self');
$this->add_render_attribute('tg-button-arg', 'rel', 'nofollow');
$this->add_render_attribute('tg-button-arg', 'class', 'btn btn-style-two');
} else {
if ( ! empty( $settings['tg_btn_link']['url'] ) ) {
$this->add_link_attributes( 'tg-button-arg', $settings['tg_btn_link'] );
$this->add_render_attribute('tg-button-arg', 'class', 'btn btn-style-two');
}
}
?>
<!-- style 2 -->
<?php if ( $settings['tp_design_style'] === 'layout-2' ): ?>
<!-- style default -->
<?php else :
$this->add_render_attribute( 'title', 'class', 'name' );
?>
<!-- team-area -->
<section class="team-area team-bg">
<div class="container">
<div class="team-wrapper">
<div class="row justify-content-center justify-content-lg-between">
<?php foreach ( $settings['teams'] as $item ) :
$title = tp_kses( $item['title' ] );
if ( !empty($item['image']['url']) ) {
$tp_team_image_url = !empty($item['image']['id']) ? wp_get_attachment_image_url( $item['image']['id'], $settings['thumbnail_size']) : $item['image']['url'];
$tp_team_image_alt = get_post_meta($item["image"]["id"], "_wp_attachment_image_alt", true);
}
?>
<div class="col-lg-3 col-md-4 col-sm-6">
<div class="team-item">
<?php if( !empty($tp_team_image_url) ) : ?>
<div class="team-thumb">
<img src="<?php echo esc_url($tp_team_image_url); ?>" alt="<?php echo esc_attr($tp_team_image_alt); ?>">
</div>
<?php endif; ?>
<div class="team-content">
<?php printf( '<%1$s %2$s>%3$s</%1$s>',
tag_escape( $settings['title_tag'] ),
$this->get_render_attribute_string( 'title' ),
$title,
); ?>
<?php if( !empty($item['designation']) ) : ?>
<span class="designation"><?php echo tp_kses( $item['designation'] ); ?></span>
<?php endif; ?>
<?php if( !empty($item['show_social'] ) ) : ?>
<div class="team__social">
<?php if( !empty($item['web_title'] ) ) : ?>
<a href="<?php echo esc_url( $item['web_title'] ); ?>"><i class="fas fa-globe"></i></a>
<?php endif; ?>
<?php if( !empty($item['email_title'] ) ) : ?>
<a href="mailto:<?php echo esc_html( $item['email_title'] ); ?>"><i class="far fa-envelope"></i></a>
<?php endif; ?>
<?php if( !empty($item['phone_title'] ) ) : ?>
<a href="tell:<?php echo esc_html( $item['phone_title'] ); ?>"><i class="fas fa-phone"></i></a>
<?php endif; ?>
<?php if( !empty($item['facebook_title'] ) ) : ?>
<a href="<?php echo esc_url( $item['facebook_title'] ); ?>"><i class="fab fa-facebook-f"></i></a>
<?php endif; ?>
<?php if( !empty($item['twitter_title'] ) ) : ?>
<a href="<?php echo esc_url( $item['twitter_title'] ); ?>"><i class="fab fa-twitter"></i></a>
<?php endif; ?>
<?php if( !empty($item['instagram_title'] ) ) : ?>
<a href="<?php echo esc_url( $item['instagram_title'] ); ?>"><i class="fab fa-instagram"></i></a>
<?php endif; ?>
<?php if( !empty($item['linkedin_title'] ) ) : ?>
<a href="<?php echo esc_url( $item['linkedin_title'] ); ?>"><i class="fab fa-linkedin-in"></i></a>
<?php endif; ?>
<?php if( !empty($item['youtube_title'] ) ) : ?>
<a href="<?php echo esc_url( $item['youtube_title'] ); ?>"><i class="fab fa-youtube"></i></a>
<?php endif; ?>
<?php if( !empty($item['googleplus_title'] ) ) : ?>
<a href="<?php echo esc_url( $item['googleplus_title'] ); ?>"><i class="fab fa-google-plus-g"></i></a>
<?php endif; ?>
<?php if( !empty($item['flickr_title'] ) ) : ?>
<a href="<?php echo esc_url( $item['flickr_title'] ); ?>"><i class="fab fa-flickr"></i></a>
<?php endif; ?>
<?php if( !empty($item['vimeo_title'] ) ) : ?>
<a href="<?php echo esc_url( $item['vimeo_title'] ); ?>"><i class="fab fa-vimeo-v"></i></a>
<?php endif; ?>
<?php if( !empty($item['behance_title'] ) ) : ?>
<a href="<?php echo esc_url( $item['behance_title'] ); ?>"><i class="fab fa-behance"></i></a>
<?php endif; ?>
<?php if( !empty($item['dribble_title'] ) ) : ?>
<a href="<?php echo esc_url( $item['dribble_title'] ); ?>"><i class="fab fa-dribbble"></i></a>
<?php endif; ?>
<?php if( !empty($item['pinterest_title'] ) ) : ?>
<a href="<?php echo esc_url( $item['pinterest_title'] ); ?>"><i class="fab fa-pinterest-p"></i></a>
<?php endif; ?>
<?php if( !empty($item['gitub_title'] ) ) : ?>
<a href="<?php echo esc_url( $item['gitub_title'] ); ?>"><i class="fab fa-github"></i></a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<?php if (!empty($settings['tg_btn_text'])) : ?>
<div class="row">
<div class="col-12">
<div class="team-btn text-center">
<a <?php echo $this->get_render_attribute_string( 'tg-button-arg' ); ?>>
<span class="text"><?php echo $settings['tg_btn_text']; ?></span>
<span class="shape"></span>
</a>
</div>
</div>
</div>
<?php endif; ?>
</div>
</section>
<!-- team-area-end -->
<?php endif; ?>
<?php
}
}
$widgets_manager->register( new TP_Team() );