File: /var/www/vhosts/byildiz.com.tr/httpdocs/wp-content/plugins/lumex-plugin/elementor/widgets/team.php
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Lumex Team Widget.
*
* @since 1.0
*/
class Lumex_Team_Widget extends Widget_Base {
public function get_name() {
return 'lumex-team';
}
public function get_title() {
return esc_html__( 'Team Card', 'lumex-plugin' );
}
public function get_icon() {
return 'eicon-parallax';
}
public function get_categories() {
return [ 'lumex-category' ];
}
/**
* Register widget controls.
*
* @since 1.0
*/
protected function register_controls() {
$this->start_controls_section(
'content_tab',
[
'label' => esc_html__( 'Content', 'lumex-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'link_type',
[
'label' => esc_html__( 'Link Type', 'lumex-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'no',
'options' => [
'no' => __( 'Default', 'lumex-plugin' ),
'link' => __( 'URL Link', 'lumex-plugin' ),
],
]
);
$this->add_control(
'url_link', [
'label' => esc_html__( 'Link', 'lumex-plugin' ),
'label_block' => true,
'type' => Controls_Manager::URL,
'show_external' => true,
'condition' => [
'link_type' => 'link'
],
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'image',
[
'label' => esc_html__( 'Image', 'lumex-plugin' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => \Elementor\Utils::get_placeholder_image_src(),
],
]
);
$this->add_control(
'name',
[
'label' => esc_html__( 'Name', 'lumex-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'placeholder' => esc_html__( 'Enter name', 'lumex-plugin' ),
'default' => esc_html__( 'Name', 'lumex-plugin' ),
]
);
$this->add_control(
'role',
[
'label' => esc_html__( 'Role', 'lumex-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'placeholder' => esc_html__( 'Enter role', 'lumex-plugin' ),
'default' => esc_html__( 'Role', 'lumex-plugin' ),
]
);
$this->end_controls_section();
$this->start_controls_section(
'items_styling',
[
'label' => esc_html__( 'Items Styles', 'lumex-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'item_icon_bgcolor',
[
'label' => esc_html__( 'Hover Button BG Color', 'lumex-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .mil-team-card .mil-portrait .mil-plus' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'item_icon_color',
[
'label' => esc_html__( 'Hover Button Color', 'lumex-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .mil-team-card .mil-portrait .mil-plus' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'item_name_color',
[
'label' => esc_html__( 'Name Color', 'lumex-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .mil-team-card .mil-el-name' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'item_name_typography',
'label' => esc_html__( 'Name Typography', 'lumex-plugin' ),
'selector' => '{{WRAPPER}} .mil-team-card .mil-el-name',
]
);
$this->add_control(
'item_role_color',
[
'label' => esc_html__( 'Role Color', 'lumex-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .mil-team-card .mil-el-role' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'item_role_typography',
'label' => esc_html__( 'Role Typography', 'lumex-plugin' ),
'selector' => '{{WRAPPER}} .mil-team-card .mil-el-role',
]
);
$this->end_controls_section();
}
/**
* Render widget output on the frontend.
*
* @since 1.0
*/
protected function render() {
$settings = $this->get_settings_for_display();
$this->add_inline_editing_attributes( 'name', 'basic' );
$this->add_inline_editing_attributes( 'role', 'basic' );
?>
<<?php if ( $settings['link_type'] !== 'no' ) : ?>a <?php if ( $settings['url_link'] ) : ?><?php if ( $settings['url_link']['is_external'] ) : ?> target="_blank"<?php endif; ?><?php if ( $settings['url_link']['nofollow'] ) : ?> rel="nofollow"<?php endif; ?> href="<?php echo esc_url( $settings['url_link']['url'] ); ?>"<?php endif; ?><?php else : ?>div<?php endif; ?> class="mil-team-card mil-angle mil-mb-4">
<div class="mil-portrait mil-mb-4 mil-sm-mb-2">
<?php if ( $settings['image'] ) : $image = wp_get_attachment_image_url( $settings['image']['id'], 'lumex_950xAuto' ); $image_alt = get_post_meta( $settings['image']['id'], '_wp_attachment_image_alt', true); ?>
<img src="<?php echo esc_url( $image ); ?>" alt="<?php echo $image_alt ? esc_attr( $image_alt ) : esc_attr__( 'image', 'lumex-plugin' ); ?>" />
<?php endif; ?>
<?php if ( $settings['link_type'] !== 'no' ) : ?>
<div class="mil-plus">
<i class="fa fa-plus"></i>
</div>
<?php endif; ?>
</div>
<div class="mil-description">
<?php if ( $settings['name'] ) : ?>
<h6 class="mil-mb-1 mil-el-name">
<span <?php echo $this->get_render_attribute_string( 'name' ); ?>>
<?php echo wp_kses_post( $settings['name'] ); ?>
</span>
</h6>
<?php endif; ?>
<?php if ( $settings['role'] ) : ?>
<p class="mil-c-m-2 mil-el-role">
<span <?php echo $this->get_render_attribute_string( 'role' ); ?>>
<?php echo wp_kses_post( $settings['role'] ); ?>
</span>
</p>
<?php endif; ?>
</div>
</<?php if ( $settings['link_type'] !== 'no' ) : ?>a<?php else : ?>div<?php endif; ?>>
<?php
}
}
Plugin::instance()->widgets_manager->register( new Lumex_Team_Widget() );