File "clients-widget.php"
Full Path: /home/stylijtl/public_html/wp-content/plugins/acens-elementor/widgets/home-parallax-image/clients-widget.php
File size: 6.97 KB
MIME-type: text/x-php
Charset: utf-8
<?php
namespace BdevsElementor\Widget;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Typography;
use Elementor\Scheme_Typography;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
/**
* Bdevs Elementor Widget.
*
* Elementor widget that inserts an embbedable content into the page, from any given URL.
*
* @since 1.0.0
*/
class Bdevsclients extends \Elementor\Widget_Base {
/**
* Get widget name.
*
* Retrieve Bdevs Elementor widget name.
*
* @since 1.0.0
* @access public
*
* @return string Widget name.
*/
public function get_name() {
return 'bdevs-clients';
}
/**
* Get widget title.
*
* Retrieve Bdevs Elementor widget title.
*
* @since 1.0.0
* @access public
*
* @return string Widget title.
*/
public function get_title() {
return __( 'Clients Home Parallax Image', 'bdevs-elementor' );
}
/**
* Get widget icon.
*
* Retrieve Bdevs Slider widget icon.
*
* @since 1.0.0
* @access public
*
* @return string Widget icon.
*/
public function get_icon() {
return 'eicon-slideshow';
}
/**
* Get widget categories.
*
* Retrieve the list of categories the Bdevs Slider widget belongs to.
*
* @since 1.0.0
* @access public
*
* @return array Widget categories.
*/
public function get_categories() {
return [ 'pages-elementor' ];
}
public function get_keywords() {
return [ 'clients', 'carousel' ];
}
public function get_script_depends() {
return [ 'bdevs-elementor'];
}
// BDT Position
protected function element_pack_position() {
$position_options = [
'' => esc_html__('Default', 'bdevs-elementor'),
'top-left' => esc_html__('Top Left', 'bdevs-elementor') ,
'top-center' => esc_html__('Top Center', 'bdevs-elementor') ,
'top-right' => esc_html__('Top Right', 'bdevs-elementor') ,
'center' => esc_html__('Center', 'bdevs-elementor') ,
'center-left' => esc_html__('Center Left', 'bdevs-elementor') ,
'center-right' => esc_html__('Center Right', 'bdevs-elementor') ,
'bottom-left' => esc_html__('Bottom Left', 'bdevs-elementor') ,
'bottom-center' => esc_html__('Bottom Center', 'bdevs-elementor') ,
'bottom-right' => esc_html__('Bottom Right', 'bdevs-elementor') ,
];
return $position_options;
}
protected function _register_controls() {
$this->start_controls_section(
'section_content_clients',
[
'label' => esc_html__( 'Clients', 'bdevs-elementor' ),
]
);
$this->add_control(
'subheading',
[
'label' => __( 'Subheading', 'bdevs-elementor' ),
'type' => Controls_Manager::TEXT,
'placeholder' => __( 'Enter your sub heading', 'bdevs-elementor' ),
'default' => __( 'Partners & Sponsors', 'bdevs-elementor' ),
'label_block' => true,
]
);
$this->add_control(
'heading',
[
'label' => __( 'Heading', 'bdevs-elementor' ),
'type' => Controls_Manager::TEXT,
'placeholder' => __( 'Enter your heading', 'bdevs-elementor' ),
'default' => __( 'Our Clients', 'bdevs-elementor' ),
'label_block' => true,
]
);
$this->add_control(
'tabs',
[
'label' => esc_html__( 'Clients Items', 'bdevs-elementor' ),
'type' => Controls_Manager::REPEATER,
'default' => [
[
'tab_title' => esc_html__( 'clients #1', 'bdevs-elementor' ),
'tab_content' => esc_html__( 'I am item content. Click edit button to change this text.', 'bdevs-elementor' ),
]
],
'fields' => [
[
'name' => 'image',
'label' => esc_html__( 'Image', 'bdevs-elementor' ),
'type' => Controls_Manager::MEDIA,
'dynamic' => [ 'active' => true ],
'default' => esc_html__( '' , 'bdevs-elementor' ),
],
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_content_layout',
[
'label' => esc_html__( 'Layout', 'bdevs-elementor' ),
]
);
$this->add_responsive_control(
'align',
[
'label' => esc_html__( 'Alignment', 'bdevs-elementor' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => esc_html__( 'Left', 'bdevs-elementor' ),
'icon' => 'fa fa-align-left',
],
'center' => [
'title' => esc_html__( 'Center', 'bdevs-elementor' ),
'icon' => 'fa fa-align-center',
],
'right' => [
'title' => esc_html__( 'Right', 'bdevs-elementor' ),
'icon' => 'fa fa-align-right',
],
'justify' => [
'title' => esc_html__( 'Justified', 'bdevs-elementor' ),
'icon' => 'fa fa-align-justify',
],
],
'prefix_class' => 'elementor%s-align-',
'description' => 'Use align to match position',
'default' => 'left',
]
);
$this->end_controls_section();
}
public function render() {
$settings = $this->get_settings_for_display();
extract($settings);
?>
<section class="clients section-padding">
<div class="container">
<div class="row mb-30">
<div class="col-md-12 text-center">
<?php if ( '' !== $settings['subheading'] ) : ?>
<h6 class="wow" data-splitting><?php echo wp_kses_post($settings['subheading']); ?></h6>
<?php endif; ?>
<?php if ( '' !== $settings['heading'] ) : ?>
<h1 class="wow" data-splitting><?php echo wp_kses_post($settings['heading']); ?></h1>
<?php endif; ?>
<div class="line-hr-section center"></div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="owl-carousel owl-theme">
<?php
$idd = 0;
foreach ( $settings['tabs'] as $item ) :
$idd++;
?>
<div class="clients-logo">
<a href="#0"><img src="<?php print esc_url($item['image']['url']); ?>" alt=""></a>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
</section>
<?php if (is_admin()) { ?>
<script type="text/javascript">
$('.clients .owl-carousel').owlCarousel({
loop: true
, margin: 30
, mouseDrag: true
, autoplay: true
, autoplayTimeout: 5000
, dots: false
, nav: false
, navText: ['<i class="fa-solid fa-angle-left"></i>', '<i class="fa-solid fa-angle-right"></i>']
, responsiveClass: true
, responsive: {
0: {
margin: 15
, items: 2
}
, 600: {
items: 3
}
, 1000: {
items: 5
}
}
});
</script>
<?php } ?>
<?php
}
}