PluginProbe
WP Directory Kit / 1.3.4
WP Directory Kit v1.3.4
1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 1.4.0 1.4.1 All 35 releases
wpdirectorykit / elementor-elements / classes / wdk-categories-carousel.php

wdk-categories-carousel.php in WP Directory Kit 1.3.4, at elementor-elements/classes/wdk-categories-carousel.php

1,046 lines 42.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Wdk\Elementor\Widgets;
4
5 use Wdk\Elementor\Widgets\WdkElementorBase;
6 use Elementor\Widget_Base;
7 use Elementor\Controls_Manager;
8 use Elementor\Utils;
9 use Elementor\Typography;
10 use Elementor\Editor;
11 use Elementor\Plugin;
12 use Elementor\Repeater;
13 use Elementor\Core\Schemes;
14 use Elementor\Icons_Manager;
15 use Elementor\Group_Control_Typography;
16 use Elementor\Group_Control_Border;
17 use Elementor\Group_Control_Box_Shadow;
18
19 if (!defined('ABSPATH'))
20 exit; // Exit if accessed directly
21
22 /**
23 * @since 1.1.0
24 */
25 class WdkCategoriesCarousel extends WdkElementorBase {
26
27 public function __construct($data = array(), $args = null) {
28
29 \Elementor\Controls_Manager::add_tab(
30 'tab_conf',
31 esc_html__('Settings', 'wpdirectorykit')
32 );
33
34 \Elementor\Controls_Manager::add_tab(
35 'tab_layout',
36 esc_html__('Layout', 'wpdirectorykit')
37 );
38
39 \Elementor\Controls_Manager::add_tab(
40 'tab_content',
41 esc_html__('Main', 'wpdirectorykit')
42 );
43
44 if ($this->is_edit_mode_load()) {
45 $this->enqueue_styles_scripts();
46 }
47
48 parent::__construct($data, $args);
49 }
50
51 /**
52 * Retrieve the widget name.
53 *
54 * @since 1.1.0
55 *
56 * @access public
57 *
58 * @return string Widget name.
59 */
60 public function get_name() {
61 return 'wdk-categories-carousel';
62 }
63
64 /**
65 * Retrieve the widget title.
66 *
67 * @since 1.1.0
68 *
69 * @access public
70 *
71 * @return string Widget title.
72 */
73 public function get_title() {
74 return esc_html__('Wdk Categories Carousel', 'wpdirectorykit');
75 }
76
77 /**
78 * Retrieve the widget icon.
79 *
80 * @since 1.1.0
81 *
82 * @access public
83 *
84 * @return string Widget icon.
85 */
86 public function get_icon() {
87 return 'eicon-carousel';
88 }
89
90 /**
91 * Register the widget controls.
92 *
93 * Adds different input fields to allow the user to change and customize the widget settings.
94 *
95 * @since 1.1.0
96 *
97 * @access protected
98 */
99 protected function register_controls() {
100 $this->generate_controls_conf();
101 $this->generate_controls_layout();
102 $this->generate_controls_styles();
103 $this->generate_controls_content();
104
105 $this->insert_pro_message('1');
106 parent::register_controls();
107 }
108
109 /**
110 * Render the widget output on the frontend.
111 *
112 * Written in PHP and used to generate the final HTML.
113 *
114 * @since 1.1.0
115 *
116 * @access protected
117 */
118 protected function render() {
119 parent::render();
120
121 $this->data['id_element'] = $this->get_id();
122 $this->data['settings'] = $this->get_settings();
123
124 $controller = 'category';
125 $this->WMVC->model($controller.'_m');
126 $this->WMVC->model('listing_m');
127 $this->data['results'] = array();
128
129 if($this->data['settings']['conf_results_type'] == 'custom_categories') {
130
131 $categories_ids = array();
132 foreach($this->data['settings']['conf_custom_results'] as $category) {
133 if(isset($category['category_id']) && !empty($category['category_id'])) {
134 $categories_ids [] = $category['category_id'];
135 }
136 }
137
138 /* where in */
139 if(!empty($categories_ids)){
140
141 $this->WMVC->db->select($this->WMVC->{$controller.'_m'}->_table_name.'.*, COUNT('.$this->WMVC->listing_m->_table_name.'.post_id) AS listings_counter');
142 $this->WMVC->db->join($this->WMVC->listing_m->_table_name.' ON '.$this->WMVC->listing_m->_table_name.'.category_id = '.$this->WMVC->{$controller.'_m'}->_table_name.'.idcategory', TRUE, 'LEFT');
143 $this->WMVC->db->where($this->WMVC->{$controller.'_m'}->_table_name.'.idcategory IN(' . implode(',', $categories_ids) . ')', null, false);
144 $this->WMVC->db->order_by('FIELD('.$this->WMVC->{$controller.'_m'}->_table_name.'.idcategory, '. implode(',', $categories_ids) . ')');
145 $this->WMVC->db->group_by($this->WMVC->{$controller.'_m'}->_primary_key);
146
147 $this->data['results'] = $this->WMVC->{$controller.'_m'}->get();
148 }
149
150 } else {
151 $order_by = NULL;
152 if(!empty($this->data['settings']['conf_order_by']))
153 $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
154
155 $where = array();
156 if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
157 $where['('.$this->WMVC->{$controller.'_m'}->_table_name.'.level = 0)'] = NULL;
158 }
159 $this->data['results'] = $this->WMVC->{$controller.'_m'}->get_pagination((!empty($this->data['settings']['conf_limit'])) ? $this->data['settings']['conf_limit'] : NULL, NULL, $where, $order_by);
160 }
161
162 $this->data['is_edit_mode']= false;
163 if(Plugin::$instance->editor->is_edit_mode())
164 $this->data['is_edit_mode']= true;
165
166 echo $this->view('wdk-categories-carousel', $this->data);
167 }
168
169 private function generate_controls_conf() {
170 $this->start_controls_section(
171 'tab_conf_main_section',
172 [
173 'label' => esc_html__('Main', 'wpdirectorykit'),
174 'tab' => '1',
175 ]
176 );
177
178 $pages = array('' => __('Not Selected', 'wpdirectorykit'));
179 foreach(get_pages(array('sort_column' => 'post_title')) as $page)
180 {
181 $pages[$page->ID] = $page->post_title.' #'.$page->ID;
182 }
183
184 $this->add_control(
185 'conf_link',
186 [
187 'label' => __( 'Open results on page', 'wpdirectorykit' ),
188 'type' => \Elementor\Controls_Manager::SELECT2,
189 'default' => '',
190 'options' => $pages
191 ]
192 );
193
194 $this->add_control(
195 'conf_results_type',
196 [
197 'label' => __( 'Show type', 'wpdirectorykit' ),
198 'type' => \Elementor\Controls_Manager::SELECT,
199 'default' => 'results_categories',
200 'options' => [
201 'results_categories' => __( 'All Categories', 'wpdirectorykit' ),
202 'custom_categories' => __( 'Specific', 'wpdirectorykit' ),
203 ],
204 'separator' => 'after',
205 ]
206 );
207
208 $this->add_control(
209 'important_note',
210 [
211 'label' => '',
212 'type' => \Elementor\Controls_Manager::RAW_HTML,
213 'raw' => wdk_sprintf(__( 'Manage Categories <a href="%1$s" target="_blank"> open </a>', 'wpdirectorykit' ), admin_url('admin.php?page=wdk_category')),
214 'content_classes' => 'wdk_elementor_hint',
215 ]
216 );
217
218 $this->add_responsive_control(
219 'only_root_enable',
220 [
221 'label' => esc_html__( 'Show only Root', 'wpdirectorykit' ),
222 'type' => Controls_Manager::SWITCHER,
223 'none' => esc_html__( 'No', 'wpdirectorykit' ),
224 'block' => esc_html__( 'Yes', 'wpdirectorykit' ),
225 'return_value' => 'yes',
226 'default' => 'yes',
227 ]
228 );
229 $this->add_control(
230 'conf_limit',
231 [
232 'label' => __( 'Limit Categories', 'wpdirectorykit' ),
233 'description' => __( 'Set 0 for unlimit', 'wpdirectorykit' ),
234 'type' => \Elementor\Controls_Manager::NUMBER,
235 'min' => 0,
236 'max' => 500,
237 'step' => 1,
238 'default' => 6,
239 'conditions' => [
240 'terms' => [
241 [
242 'name' => 'conf_results_type',
243 'operator' => '==',
244 'value' => 'results_categories',
245 ]
246 ],
247 ],
248 ]
249 );
250
251 $this->add_control(
252 'conf_order_by',
253 [
254 'label' => __('Order By Column', 'wpdirectorykit'),
255 'type' => Controls_Manager::SELECT,
256 'label_block' => true,
257 'options' => [
258 '' => __('None', 'wpdirectorykit'),
259 'category_title' => __('Title', 'wpdirectorykit'),
260 'idcategory' => __('Category id', 'wpdirectorykit'),
261 'order_index' => __('Order index', 'wpdirectorykit'),
262 'listings_counter' => __('Most Listings', 'wpdirectorykit'),
263 ],
264 'default' => 'order_index',
265 'conditions' => [
266 'terms' => [
267 [
268 'name' => 'conf_results_type',
269 'operator' => '==',
270 'value' => 'results_categories',
271 ]
272 ],
273 ],
274 ]
275 );
276
277 $this->add_control(
278 'conf_order',
279 [
280 'label' => __('Order', 'wpdirectorykit'),
281 'type' => Controls_Manager::SELECT,
282 'label_block' => true,
283 'options' => [
284 'asc' => __('Ascending', 'wpdirectorykit'),
285 'desc' => __('Descending', 'wpdirectorykit')
286 ],
287 'default' => 'asc',
288 'conditions' => [
289 'terms' => [
290 [
291 'name' => 'conf_results_type',
292 'operator' => '==',
293 'value' => 'results_categories',
294 ]
295 ],
296 ],
297 ]
298 );
299
300
301 $this->add_control(
302 'complete_link_enable',
303 [
304 'label' => __( 'Complete Link', 'wpdirectorykit' ),
305 'type' => \Elementor\Controls_Manager::SWITCHER,
306 'label_on' => __( 'On', 'wpdirectorykit' ),
307 'label_off' => __( 'Off', 'wpdirectorykit' ),
308 'return_value' => 'yes',
309 'default' => '',
310 ]
311 );
312
313 if(true){
314 $repeater = new Repeater();
315 $repeater->start_controls_tabs( 'categories' );
316 $repeater->add_control(
317 'category_id',
318 [
319 'label' => __( 'ID Category', 'wpdirectorykit' ),
320 'type' => \Elementor\Controls_Manager::NUMBER,
321 'min' => 1,
322 'step' => 1,
323 ]
324 );
325 $repeater->end_controls_tabs();
326
327
328 $this->add_control(
329 'conf_custom_results',
330 [
331 'type' => Controls_Manager::REPEATER,
332 'fields' => $repeater->get_controls(),
333 'default' => [
334 ],
335 'title_field' => '{{{ category_id }}}',
336 'conditions' => [
337 'terms' => [
338 [
339 'name' => 'conf_results_type',
340 'operator' => '==',
341 'value' => 'custom_categories',
342 ]
343 ],
344 ],
345 ]
346 );
347
348 }
349
350 $this->end_controls_section();
351
352 }
353
354 private function generate_controls_layout() {
355
356 /* START Section t_options_slider */
357 if(true){
358 $this->start_controls_section(
359 'tab_options_slider',
360 [
361 'label' => esc_html__('Slider options', 'wpdirectorykit'),
362 'tab' => 'tab_options',
363 ]
364 );
365
366 $this->add_responsive_control(
367 'column_gap',
368 [
369 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
370 'type' => Controls_Manager::SLIDER,
371 'default' => [
372 'size' => 0,
373 ],
374 'range' => [
375 'px' => [
376 'min' => 0,
377 'max' => 60,
378 ],
379 ],
380 'selectors' => [
381 '{{WRAPPER}} .slick-slide' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};;',
382 ],
383 ]
384 );
385
386 $this->add_responsive_control(
387 'custom_width',
388 [
389 'label' => esc_html__('Columns Custom Width', 'wpdirectorykit'),
390 'type' => Controls_Manager::SLIDER,
391 'default' => [
392 'size' => '',
393 ],
394 'range' => [
395 'px' => [
396 'min' => 0,
397 'max' => 1200,
398 ],
399 ],
400 'selectors' => [
401 '{{WRAPPER}} .slick-slide .wdk-slider-item' => 'width: {{SIZE}}{{UNIT}} !important;',
402 ],
403 ]
404 );
405
406 $this->add_control(
407 'layout_carousel_center',
408 [
409 'label' => __( 'Center', 'wpdirectorykit' ),
410 'type' => \Elementor\Controls_Manager::SWITCHER,
411 'label_on' => __( 'On', 'wpdirectorykit' ),
412 'label_off' => __( 'Off', 'wpdirectorykit' ),
413 'return_value' => 'yes',
414 'default' => '',
415 ]
416 );
417
418 $this->add_control(
419 'layout_carousel_variableWidth',
420 [
421 'label' => __( 'variableWidth', 'wpdirectorykit' ),
422 'type' => \Elementor\Controls_Manager::SWITCHER,
423 'label_on' => __( 'On', 'wpdirectorykit' ),
424 'label_off' => __( 'Off', 'wpdirectorykit' ),
425 'return_value' => 'yes',
426 'default' => '',
427 ]
428 );
429
430 $this->add_control(
431 'layout_carousel_is_infinite',
432 [
433 'label' => __( 'Infinite', 'wpdirectorykit' ),
434 'type' => \Elementor\Controls_Manager::SWITCHER,
435 'label_on' => __( 'On', 'wpdirectorykit' ),
436 'label_off' => __( 'Off', 'wpdirectorykit' ),
437 'return_value' => 'true',
438 'default' => 'true',
439 ]
440 );
441
442 $this->add_control(
443 'layout_carousel_is_autoplay',
444 [
445 'label' => __( 'Autoplay', 'wpdirectorykit' ),
446 'type' => \Elementor\Controls_Manager::SWITCHER,
447 'label_on' => __( 'On', 'wpdirectorykit' ),
448 'label_off' => __( 'Off', 'wpdirectorykit' ),
449 'return_value' => 'true',
450 'default' => '',
451 ]
452 );
453
454 $this->add_control(
455 'layout_carousel_columns',
456 [
457 'label' => __( 'Count grid', 'wpdirectorykit' ),
458 'type' => \Elementor\Controls_Manager::NUMBER,
459 'min' => 1,
460 'max' => 10,
461 'step' => 1,
462 'default' => 1,
463 ]
464 );
465
466 $this->add_control(
467 'layout_carousel_speed',
468 [
469 'label' => __( 'Speed', 'wpdirectorykit' ),
470 'type' => \Elementor\Controls_Manager::NUMBER,
471 'min' => 0,
472 'max' => 100000,
473 'step' => 100,
474 'default' => 500,
475 ]
476 );
477 $this->add_control(
478 'layout_carousel_autoplaySpeed',
479 [
480 'label' => __( 'Speed', 'wpdirectorykit' ),
481 'type' => \Elementor\Controls_Manager::NUMBER,
482 'min' => 0,
483 'max' => 100000,
484 'step' => 100,
485 'default' => 500,
486 ]
487 );
488
489 $this->add_control(
490 'layout_carousel_animation_style',
491 [
492 'label' => __( 'Animation Style', 'wpdirectorykit' ),
493 'type' => \Elementor\Controls_Manager::SELECT,
494 'default' => 'fade',
495 'options' => [
496 'slide' => __( 'Slide', 'wpdirectorykit' ),
497 'fade' => __( 'Fade', 'wpdirectorykit' ),
498 'fade_in_in' => __( 'Fade in', 'wpdirectorykit' ),
499 ],
500 ]
501 );
502
503 $this->add_control(
504 'layout_carousel_cssease',
505 [
506 'label' => __( 'cssEase', 'wpdirectorykit' ),
507 'type' => \Elementor\Controls_Manager::SELECT,
508 'default' => 'linear',
509 'options' => [
510 'linear' => __( 'linear', 'wpdirectorykit' ),
511 'ease' => __( 'ease', 'wpdirectorykit' ),
512 'ease-in' => __( 'ease-in', 'wpdirectorykit' ),
513 'ease-out' => __( 'ease-out', 'wpdirectorykit' ),
514 'ease-in-out' => __( 'ease-in-out', 'wpdirectorykit' ),
515 'step-start' => __( 'step-start', 'wpdirectorykit' ),
516 'step-end' => __( 'step-end', 'wpdirectorykit' ),
517 ],
518 ]
519 );
520
521 $this->end_controls_section();
522 }
523
524 /* START Section t_options_slider */
525 if(true){
526 $this->start_controls_section(
527 'tab_styles_image',
528 [
529 'label' => esc_html__('Section Image', 'wpdirectorykit'),
530 'tab' => Controls_Manager::TAB_STYLE,
531 ]
532 );
533
534 $this->add_responsive_control(
535 't_styles_img_des_type',
536 [
537 'label' => __( 'Design type', 'wpdirectorykit' ),
538 'type' => \Elementor\Controls_Manager::SELECT,
539 'default' => 'wdk-image_cover',
540 'options' => [
541 '' => __( 'Default Sizes', 'wpdirectorykit' ),
542 'wdk-image_size_cover' => __( 'Image auto crop/resize', 'wpdirectorykit' ),
543 'wdk-image_cover' => __( 'Image cover (like background)', 'wpdirectorykit' ),
544 ],
545 ]
546 );
547
548 $this->add_responsive_control(
549 't_styles_img_des_height',
550 [
551 'label' => esc_html__('Height', 'wpdirectorykit'),
552 'type' => Controls_Manager::SLIDER,
553 'range' => [
554 'px' => [
555 'min' => 300,
556 'max' => 1500,
557 ],
558 ],
559 'render_type' => 'template',
560 'default' => [
561 'size' => 350,
562 ],
563 'selectors' => [
564 '{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_ini.wdk-image_cover .slick-list,
565 {{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_ini.wdk-image_size_cover .wdk-slider-item .wdk-slider-item_thumbnail' => 'height: {{SIZE}}px',
566 ],
567 'separator' => 'after',
568 'conditions' => [
569 'relation' => 'or',
570 'terms' => [
571 [
572 'name' => 't_styles_img_des_type',
573 'operator' => '==',
574 'value' => 'wdk-image_size_cover',
575 ],
576 [
577 'name' => 't_styles_img_des_type',
578 'operator' => '==',
579 'value' => 'wdk-image_cover',
580 ]
581 ],
582 ]
583 ]
584 );
585 $this->end_controls_section();
586
587 $this->start_controls_section(
588 'tab_styles_arrows_section',
589 [
590 'label' => esc_html__('Section Arrows', 'wpdirectorykit'),
591 'tab' => Controls_Manager::TAB_STYLE,
592 ]
593 );
594
595 $this->add_responsive_control(
596 't_styles_arrows_hide',
597 [
598 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
599 'type' => Controls_Manager::SWITCHER,
600 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
601 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
602 'return_value' => 'none',
603 'default' => '',
604 'selectors' => [
605 '{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_arrows' => 'display: {{VALUE}};',
606 ],
607 ]
608 );
609
610
611 $this->add_responsive_control(
612 't_styles_arrows_position',
613 [
614 'label' => __( 'Position', 'wpdirectorykit' ),
615 'type' => \Elementor\Controls_Manager::SELECT,
616 'default' => 'wdk-categories-carousel_arrows_bottom',
617 'options' => [
618 'wdk-categories-carousel_arrows_bottom' => __( 'Bottom', 'wpdirectorykit' ),
619 'wdk-categories-carousel_arrows_middle' => __( 'Center', 'wpdirectorykit' ),
620 'wdk-categories-carousel_arrows_top' => __( 'Top', 'wpdirectorykit' ),
621 ],
622 ]
623 );
624
625 $this->add_responsive_control(
626 't_styles_arrows_position_style',
627 [
628 'label' => __( 'Position Style', 'wpdirectorykit' ),
629 'type' => \Elementor\Controls_Manager::SELECT,
630 'default' => 'wdk-categories-carousel_arrows_out',
631 'options' => [
632 'wdk-categories-carousel_arrows_out' => __( 'Out', 'wpdirectorykit' ),
633 'wdk-categories-carousel_arrows_in' => __( 'In', 'wpdirectorykit' ),
634 ],
635 ]
636 );
637
638 $this->add_responsive_control(
639 't_styles_arrows_align',
640 [
641 'label' => __( 'Align', 'wpdirectorykit' ),
642 'type' => Controls_Manager::CHOOSE,
643 'options' => [
644 'left' => [
645 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
646 'icon' => 'eicon-text-align-left',
647 ],
648 'center' => [
649 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
650 'icon' => 'eicon-text-align-center',
651 ],
652 'right' => [
653 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
654 'icon' => 'eicon-text-align-right',
655 ],
656 'justify' => [
657 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
658 'icon' => 'eicon-text-align-justify',
659 ],
660 ],
661 'render_type' => 'template',
662 'selectors_dictionary' => [
663 'left' => 'justify-content: flex-start;',
664 'center' => 'justify-content: center;',
665 'right' => 'justify-content: flex-end;',
666 'justify' => 'justify-content: space-between;',
667 ],
668 'selectors' => [
669 '{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_arrows' => '{{VALUE}};',
670 ],
671 'conditions' => [
672 'relation' => 'or',
673 'terms' => [
674 [
675 'name' => 't_styles_img_des_type',
676 'operator' => '==',
677 'value' => 'wdk-image_size_cover',
678 ],
679 [
680 'name' => 't_styles_img_des_type',
681 'operator' => '==',
682 'value' => 'wdk-image_cover',
683 ]
684 ],
685 ],
686 ]
687 );
688
689 $this->add_responsive_control(
690 'styles_carousel_arrows_icon_left_h',
691 [
692 'label' => esc_html__('Arrow left', 'wpdirectorykit'),
693 'type' => Controls_Manager::HEADING,
694 'separator' => 'before',
695 ]
696 );
697 $selectors = array(
698 'normal' => '{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_arrows .wdk-categories-carousel_arrow.wdk-slider-prev',
699 );
700 $this->generate_renders_tabs($selectors, 'styles_carousel_arrows_icon_left', ['margin']);
701
702 $this->add_responsive_control(
703 'styles_carousel_arrows_icon_left',
704 [
705 'label' => esc_html__('Icon', 'wpdirectorykit'),
706 'type' => Controls_Manager::ICONS,
707 'label_block' => true,
708 'default' => [
709 'value' => 'fa fa-angle-left',
710 'library' => 'solid',
711 ],
712 ]
713 );
714
715 $this->add_responsive_control(
716 'styles_carousel_arrows_icon_right_h',
717 [
718 'label' => esc_html__('Arrow right', 'wpdirectorykit'),
719 'type' => Controls_Manager::HEADING,
720 'separator' => 'before',
721 ]
722 );
723 $selectors = array(
724 'normal' => '{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_arrows .wdk-categories-carousel_arrow.wdk-slider-next',
725 );
726 $this->generate_renders_tabs($selectors, 'styles_carousel_arrows_icon_right', ['margin']);
727
728 $this->add_responsive_control(
729 'styles_carousel_arrows_icon_right',
730 [
731 'label' => esc_html__('Icon', 'wpdirectorykit'),
732 'type' => Controls_Manager::ICONS,
733 'label_block' => true,
734 'default' => [
735 'value' => 'fa fa-angle-right',
736 'library' => 'solid',
737 ],
738 ]
739 );
740
741 $selectors = array(
742 'normal' => '{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_arrows .wdk-categories-carousel_arrow',
743 'hover'=>'{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_arrows .wdk-categories-carousel_arrow%1$s'
744 );
745 $this->generate_renders_tabs($selectors, 't_styles_arrows_s', ['typo','color','background','border','border_radius','padding','shadow','transition']);
746
747 $this->end_controls_section();
748
749 $this->start_controls_section(
750 'tab_styles_dots_section',
751 [
752 'label' => esc_html__('Section Dots', 'wpdirectorykit'),
753 'tab' => Controls_Manager::TAB_STYLE,
754 ]
755 );
756
757 $this->add_responsive_control(
758 't_styles_dots_hide',
759 [
760 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
761 'type' => Controls_Manager::SWITCHER,
762 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
763 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
764 'return_value' => 'none',
765 'default' => '',
766 'selectors' => [
767 '{{WRAPPER}} .wdk-categories-carousel .slick-dots' => 'display: {{VALUE}} !important;',
768 ],
769 ]
770 );
771
772 $this->add_responsive_control(
773 't_styles_dots_position_style',
774 [
775 'label' => __( 'Position Style', 'wpdirectorykit' ),
776 'type' => \Elementor\Controls_Manager::SELECT,
777 'default' => 'wdk-categories-carousel_dots_out',
778 'options' => [
779 'wdk-categories-carousel_dots_out' => __( 'Out', 'wpdirectorykit' ),
780 'wdk-categories-carousel_dots_in' => __( 'In', 'wpdirectorykit' ),
781 ],
782 ]
783 );
784
785 $this->add_responsive_control(
786 't_styles_dots_align',
787 [
788 'label' => __( 'Position', 'wpdirectorykit' ),
789 'type' => Controls_Manager::CHOOSE,
790 'options' => [
791 'left' => [
792 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
793 'icon' => 'eicon-text-align-left',
794 ],
795 'center' => [
796 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
797 'icon' => 'eicon-text-align-center',
798 ],
799 'right' => [
800 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
801 'icon' => 'eicon-text-align-right',
802 ],
803 'justify' => [
804 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
805 'icon' => 'eicon-text-align-justify',
806 ],
807 ],
808 'render_type' => 'template',
809 'selectors_dictionary' => [
810 'left' => 'justify-content: flex-start;',
811 'center' => 'justify-content: center;',
812 'right' => 'justify-content: flex-end;',
813 'justify' => 'justify-content: space-between;',
814 ],
815 'selectors' => [
816 '{{WRAPPER}} .wdk-categories-carousel .slick-dots' => '{{VALUE}};',
817 ],
818 ]
819 );
820
821 $this->add_responsive_control(
822 'styles_carousel_dots_position_style',
823 [
824 'label' => esc_html__('Icon', 'wpdirectorykit'),
825 'type' => Controls_Manager::ICONS,
826 'label_block' => true,
827 'default' => [
828 'value' => 'fas fa-circle',
829 'library' => 'solid',
830 ],
831 ]
832 );
833
834 $selectors = array(
835 'normal' => '{{WRAPPER}} .wdk-categories-carousel .slick-dots li .wdk-dot',
836 'hover'=>'{{WRAPPER}} .wdk-categories-carousel .slick-dots li .wdk-dot%1$s'
837 );
838 $this->generate_renders_tabs($selectors, 't_styles_dots__s', 'full', ['align']);
839
840 $this->end_controls_section();
841
842 }
843
844 }
845
846 private function generate_controls_styles() {
847
848 }
849
850 private function generate_controls_content() {
851
852 if(true){
853 $this->start_controls_section(
854 'tab_content',
855 [
856 'label' => esc_html__('Basic', 'wpdirectorykit'),
857 'tab' => 'tab_content',
858 ]
859 );
860
861 $this->add_responsive_control(
862 't_content_basic_position_y',
863 [
864 'label' => __( 'Position Y', 'wpdirectorykit' ),
865 'type' => Controls_Manager::CHOOSE,
866 'options' => [
867 'top' => [
868 'title' => esc_html__( 'Top', 'wpdirectorykit' ),
869 'icon' => 'eicon-text-align-left',
870 ],
871 'center' => [
872 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
873 'icon' => 'eicon-text-align-center',
874 ],
875 'bottom' => [
876 'title' => esc_html__( 'Bottom', 'wpdirectorykit' ),
877 'icon' => 'eicon-text-align-right',
878 ],
879 'justify' => [
880 'title' => esc_html__( 'Default', 'wpdirectorykit' ),
881 'icon' => 'eicon-text-align-justify',
882 ],
883 ],
884 'default' => 'left',
885 'render_type' => 'template',
886 'selectors_dictionary' => [
887 'top' => 'justify-content: flex-start;',
888 'center' => 'justify-content: center;',
889 'bottom' => 'justify-content: flex-end;',
890 'justify' => 'justify-content: space-between;',
891 ],
892 'selectors' => [
893 '{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_ini .wdk-slider-item' => '{{VALUE}};',
894 ],
895 ]
896 );
897
898 $this->add_responsive_control(
899 't_content_basic_position_x',
900 [
901 'label' => __( 'Position X', 'wpdirectorykit' ),
902 'type' => Controls_Manager::CHOOSE,
903 'options' => [
904 'left' => [
905 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
906 'icon' => 'eicon-text-align-left',
907 ],
908 'center' => [
909 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
910 'icon' => 'eicon-text-align-center',
911 ],
912 'right' => [
913 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
914 'icon' => 'eicon-text-align-right',
915 ],
916 'justify' => [
917 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
918 'icon' => 'eicon-text-align-justify',
919 ],
920 ],
921 'default' => 'left',
922 'render_type' => 'template',
923 'selectors_dictionary' => [
924 'left' => 'align-items: flex-start;',
925 'center' => 'align-items: center;',
926 'right' => 'align-items: flex-end;',
927 'justify' => 'align-items: stretch;',
928 ],
929 'selectors' => [
930 '{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_ini .wdk-slider-item' => '{{VALUE}};',
931 ],
932 ]
933 );
934
935 $this->add_responsive_control(
936 't_content_basic_link_text',
937 [
938 'label' => __( 'Text of Link', 'wpdirectorykit' ),
939 'type' => \Elementor\Controls_Manager::TEXT,
940 'default' => __( 'View', 'wpdirectorykit' ),
941 ]
942 );
943
944 $selectors = array(
945 'normal' => '{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_ini .wdk-categories-carousel_mask',
946 );
947 $this->generate_renders_tabs($selectors, 't_content_basic_s', ['background']);
948
949 $this->end_controls_section();
950
951 $this->start_controls_section(
952 'tab_content_title',
953 [
954 'label' => esc_html__('Title', 'wpdirectorykit'),
955 'tab' => 'tab_content',
956 ]
957 );
958 $this->add_responsive_control(
959 'tab_content_title_hide',
960 [
961 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
962 'type' => Controls_Manager::SWITCHER,
963 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
964 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
965 'return_value' => 'none',
966 'default' => '',
967 'selectors' => [
968 '{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_title' => 'display: {{VALUE}};',
969 ],
970 ]
971 );
972 $selectors = array(
973 'normal' => '{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_title',
974 'hover'=>'{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_title%1$s'
975 );
976 $this->generate_renders_tabs($selectors, 'tab_content_title_s', 'full');
977 $this->end_controls_section();
978
979 $this->start_controls_section(
980 'tab_content_content',
981 [
982 'label' => esc_html__('Content', 'wpdirectorykit'),
983 'tab' => 'tab_content',
984 ]
985 );
986 $this->add_responsive_control(
987 'tab_content_content_hide',
988 [
989 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
990 'type' => Controls_Manager::SWITCHER,
991 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
992 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
993 'return_value' => 'none',
994 'default' => '',
995 'selectors' => [
996 '{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_content' => 'display: {{VALUE}};',
997 ],
998 ]
999 );
1000 $selectors = array(
1001 'normal' => '{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_content',
1002 'hover'=>'{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_content%1$s'
1003 );
1004 $this->generate_renders_tabs($selectors, 'tab_content_content_s', 'full');
1005 $this->end_controls_section();
1006
1007 $this->start_controls_section(
1008 'tab_content_link',
1009 [
1010 'label' => esc_html__('Link', 'wpdirectorykit'),
1011 'tab' => 'tab_content',
1012 ]
1013 );
1014 $this->add_responsive_control(
1015 'tab_content_link_hide',
1016 [
1017 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
1018 'type' => Controls_Manager::SWITCHER,
1019 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
1020 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
1021 'return_value' => 'none',
1022 'default' => '',
1023 'selectors' => [
1024 '{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_link' => 'display: {{VALUE}};',
1025 ],
1026 ]
1027 );
1028 $selectors = array(
1029 'normal' => '{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_link',
1030 'hover'=>'{{WRAPPER}} .wdk-categories-carousel .wdk-categories-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_link%1$s'
1031 );
1032 $this->generate_renders_tabs($selectors, 'tab_content_link_s', 'full');
1033 $this->end_controls_section();
1034
1035 }
1036 }
1037
1038 public function enqueue_styles_scripts() {
1039 wp_enqueue_style('slick');
1040 wp_enqueue_style('slick-theme');
1041 wp_enqueue_script('slick');
1042 wp_enqueue_style('wdk-categories-carousel');
1043 }
1044
1045 }
1046