<?php
$slides_to_show = range( 1, 10 );
$slides_to_show = array_combine( $slides_to_show, $slides_to_show );
// Register Widget
ct_add_custom_widget(
array(
'name' => 'ct_client_carousel',
'title' => esc_html__('Case Client Carousel', 'itfirm'),
'icon' => 'eicon-person',
'categories' => array(Case_Theme_Core::CT_CATEGORY_NAME),
'scripts' => array(
'jquery-slick',
'ct-post-carousel-widget-js',
),
'params' => array(
'sections' => array(
array(
'name' => 'section_content',
'label' => esc_html__('Content', 'itfirm'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'controls' => array(
array(
'name' => 'style',
'label' => esc_html__('Style', 'itfirm' ),
'type' => \Elementor\Controls_Manager::SELECT,
'options' => [
'style1' => 'Style 1',
'style2' => 'Style 2',
],
'default' => 'style1',
),
array(
'name' => 'clients',
'label' => esc_html__('Clients', 'itfirm'),
'type' => \Elementor\Controls_Manager::REPEATER,
'controls' => array(
array(
'name' => 'client_name',
'label' => esc_html__('Client Name', 'itfirm'),
'type' => \Elementor\Controls_Manager::TEXT,
'label_block' => true,
),
array(
'name' => 'client_link',
'label' => esc_html__('Client URL', 'itfirm'),
'type' => \Elementor\Controls_Manager::URL,
'label_block' => true,
),
array(
'name' => 'client_logo',
'label' => esc_html__('Client Logo', 'itfirm'),
'type' => \Elementor\Controls_Manager::MEDIA,
'label_block' => true,
),
array(
'name' => 'client_logo_hover',
'label' => esc_html__('Client Logo Hover', 'itfirm'),
'type' => \Elementor\Controls_Manager::MEDIA,
'label_block' => true,
),
),
'title_field' => '{{{ client_name }}}',
),
),
),
array(
'name' => 'section_carousel_settings',
'label' => esc_html__('Carousel Settings', 'itfirm'),
'tab' => \Elementor\Controls_Manager::TAB_SETTINGS,
'controls' => array(
array(
'name' => 'ct_animate',
'label' => esc_html__('Case Animate', 'itfirm' ),
'type' => \Elementor\Controls_Manager::SELECT,
'options' => itfirm_animate(),
'default' => '',
),
array(
'name' => 'col_xs',
'label' => esc_html__('Columns XS Devices', 'itfirm' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => '1',
'options' => [
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'6' => '6',
],
),
array(
'name' => 'col_sm',
'label' => esc_html__('Columns SM Devices', 'itfirm' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => '2',
'options' => [
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'6' => '6',
],
),
array(
'name' => 'col_md',
'label' => esc_html__('Columns MD Devices', 'itfirm' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => '3',
'options' => [
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'6' => '6',
],
),
array(
'name' => 'col_lg',
'label' => esc_html__('Columns LG Devices', 'itfirm' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => '3',
'options' => [
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'6' => '6',
],
),
array(
'name' => 'col_xl',
'label' => esc_html__('Columns XL Devices', 'itfirm' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => '3',
'options' => [
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'5' => esc_html__('5', 'itfirm' ),
'6' => '6',
'7' => esc_html__('7', 'itfirm' ),
],
),
array(
'name' => 'slides_to_scroll',
'label' => esc_html__('Slides to scroll', 'itfirm' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => '1',
'options' => [
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'5' => esc_html__('5', 'itfirm' ),
'6' => '6',
'7' => esc_html__('7', 'itfirm' ),
],
),
array(
'name' => 'arrows',
'label' => esc_html__('Show Arrows', 'itfirm'),
'type' => \Elementor\Controls_Manager::SWITCHER,
),
array(
'name' => 'dots',
'label' => esc_html__('Show Dots', 'itfirm'),
'type' => \Elementor\Controls_Manager::SWITCHER,
),
array(
'name' => 'pause_on_hover',
'label' => esc_html__('Pause on Hover', 'itfirm'),
'type' => \Elementor\Controls_Manager::SWITCHER,
),
array(
'name' => 'autoplay',
'label' => esc_html__('Autoplay', 'itfirm'),
'type' => \Elementor\Controls_Manager::SWITCHER,
),
array(
'name' => 'autoplay_speed',
'label' => esc_html__('Autoplay Speed', 'itfirm'),
'type' => \Elementor\Controls_Manager::NUMBER,
'default' => 5000,
'condition' => [
'autoplay' => 'true'
]
),
array(
'name' => 'infinite',
'label' => esc_html__('Infinite Loop', 'itfirm'),
'type' => \Elementor\Controls_Manager::SWITCHER,
),
array(
'name' => 'speed',
'label' => esc_html__('Animation Speed', 'itfirm'),
'type' => \Elementor\Controls_Manager::NUMBER,
'default' => 500,
),
),
),
),
),
),
get_template_directory() . '/elementor/core/widgets/'
);