PluginProbe
WP Directory Kit / 1.2.3
WP Directory Kit v1.2.3
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-grid.php

wdk-categories-grid.php in WP Directory Kit 1.2.3, at elementor-elements/classes/wdk-categories-grid.php

801 lines 29.4 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 WdkCategoriesGrid 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-grid';
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 Grid', '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-sitemap';
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 $this->data['id_element'] = $this->get_id();
121 $this->data['settings'] = $this->get_settings();
122
123 $controller = 'category';
124 $this->WMVC->model($controller.'_m');
125 $this->WMVC->model('listing_m');
126
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 $this->data['results'] = $this->WMVC->{$controller.'_m'}->get_pagination($this->data['settings']['conf_limit'], NULL, array(), $order_by);
156 }
157
158 $this->data['is_edit_mode']= false;
159 if(Plugin::$instance->editor->is_edit_mode())
160 $this->data['is_edit_mode']= true;
161
162 echo $this->view('wdk-categories-grid', $this->data);
163 }
164
165
166 private function generate_controls_conf() {
167 $this->start_controls_section(
168 'tab_conf_main_section',
169 [
170 'label' => esc_html__('Main', 'wpdirectorykit'),
171 'tab' => '1',
172 ]
173 );
174
175 $pages = array('' => __('Not Selected', 'wpdirectorykit'));
176 foreach(get_pages(array('sort_column' => 'post_title')) as $page)
177 {
178 $pages[$page->ID] = $page->post_title.' #'.$page->ID;
179 }
180
181 $this->add_control(
182 'conf_link',
183 [
184 'label' => __( 'Open results on page', 'wpdirectorykit' ),
185 'type' => \Elementor\Controls_Manager::SELECT,
186 'default' => '',
187 'options' => $pages
188 ]
189 );
190
191 $this->add_control(
192 'conf_results_type',
193 [
194 'label' => __( 'Results type', 'wpdirectorykit' ),
195 'type' => \Elementor\Controls_Manager::SELECT,
196 'default' => 'results_categories',
197 'options' => [
198 'results_categories' => __( 'All Categories', 'wpdirectorykit' ),
199 'custom_categories' => __( 'Specific', 'wpdirectorykit' ),
200 ],
201 'separator' => 'after',
202 ]
203 );
204
205
206 $this->add_control(
207 'important_note',
208 [
209 'label' => '',
210 'type' => \Elementor\Controls_Manager::RAW_HTML,
211 'raw' => sprintf(__( 'Manage Categories <a href="%1$s" target="_blank"> open </a>', 'wpdirectorykit' ), admin_url('admin.php?page=wdk_category')),
212 'content_classes' => 'wdk_elementor_hint',
213 ]
214 );
215
216 $this->add_control(
217 'conf_limit',
218 [
219 'label' => __( 'Limit Categories', 'wpdirectorykit' ),
220 'type' => \Elementor\Controls_Manager::NUMBER,
221 'min' => 1,
222 'max' => 50,
223 'step' => 1,
224 'default' => 6,
225 'separator' => 'before',
226 'conditions' => [
227 'terms' => [
228 [
229 'name' => 'conf_results_type',
230 'operator' => '==',
231 'value' => 'results_categories',
232 ]
233 ],
234 ],
235 ]
236 );
237
238 $this->add_control(
239 'conf_order_by',
240 [
241 'label' => __('Order By Column', 'wpdirectorykit'),
242 'type' => Controls_Manager::SELECT,
243 'label_block' => true,
244 'options' => [
245 '' => __('None', 'wpdirectorykit'),
246 'category_title' => __('Title', 'wpdirectorykit'),
247 'idcategory' => __('Category id', 'wpdirectorykit'),
248 'order_index' => __('Order index', 'wpdirectorykit'),
249 'listings_counter' => __('Most Listings', 'wpdirectorykit'),
250 ],
251 'default' => 'order_index',
252 'conditions' => [
253 'terms' => [
254 [
255 'name' => 'conf_results_type',
256 'operator' => '==',
257 'value' => 'results_categories',
258 ]
259 ],
260 ],
261 ]
262 );
263
264 $this->add_control(
265 'conf_order',
266 [
267 'label' => __('Order', 'wpdirectorykit'),
268 'type' => Controls_Manager::SELECT,
269 'label_block' => true,
270 'options' => [
271 'asc' => __('Ascending', 'wpdirectorykit'),
272 'desc' => __('Descending', 'wpdirectorykit')
273 ],
274 'default' => 'desc',
275 'conditions' => [
276 'terms' => [
277 [
278 'name' => 'conf_results_type',
279 'operator' => '==',
280 'value' => 'results_categories',
281 ]
282 ],
283 ],
284 ]
285 );
286
287 if(true){
288 $repeater = new Repeater();
289 $repeater->start_controls_tabs( 'categories' );
290 $repeater->add_control(
291 'category_id',
292 [
293 'label' => __( 'ID Category', 'wpdirectorykit' ),
294 'type' => \Elementor\Controls_Manager::NUMBER,
295 'min' => 1,
296 'step' => 1,
297 ]
298 );
299 $repeater->end_controls_tabs();
300
301
302 $this->add_control(
303 'conf_custom_results',
304 [
305 'type' => Controls_Manager::REPEATER,
306 'fields' => $repeater->get_controls(),
307 'default' => [
308 ],
309 'title_field' => '{{{ category_id }}}',
310 'conditions' => [
311 'terms' => [
312 [
313 'name' => 'conf_results_type',
314 'operator' => '==',
315 'value' => 'custom_categories',
316 ]
317 ],
318 ],
319 ]
320 );
321 }
322
323 $this->end_controls_section();
324 }
325
326 private function generate_controls_layout() {
327
328 /* START Section t_options_slider */
329 $this->start_controls_section(
330 'tab_options_slider',
331 [
332 'label' => esc_html__('Options', 'wpdirectorykit'),
333 'tab' => 'tab_options',
334 ]
335 );
336
337
338 $this->add_control(
339 'layout_carousel_enable',
340 [
341 'label' => __( 'Carousel Enable', 'wpdirectorykit' ),
342 'type' => \Elementor\Controls_Manager::SWITCHER,
343 'label_on' => __( 'On', 'wpdirectorykit' ),
344 'label_off' => __( 'Off', 'wpdirectorykit' ),
345 'return_value' => 'yes',
346 'default' => '',
347 ]
348 );
349
350
351 $this->add_responsive_control(
352 'layout_carousel_column_gap',
353 [
354 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
355 'type' => Controls_Manager::SLIDER,
356 'default' => [
357 'size' => 15,
358 ],
359 'range' => [
360 'px' => [
361 'min' => 0,
362 'max' => 60,
363 ],
364 ],
365 'selectors' => [
366 '{{WRAPPER}} .slick-slide' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};',
367 '{{WRAPPER}} .wdk-categories-grid .wdk-carousel_ini' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};',
368 ],
369 'conditions' => [
370 'terms' => [
371 [
372 'name' => 'layout_carousel_enable',
373 'operator' => '==',
374 'value' => 'yes',
375 ]
376 ],
377 ],
378 ]
379 );
380
381 $this->add_control(
382 'layout_carousel_center',
383 [
384 'label' => __( 'Center', 'wpdirectorykit' ),
385 'type' => \Elementor\Controls_Manager::SWITCHER,
386 'label_on' => __( 'On', 'wpdirectorykit' ),
387 'label_off' => __( 'Off', 'wpdirectorykit' ),
388 'return_value' => 'yes',
389 'default' => '',
390 'conditions' => [
391 'terms' => [
392 [
393 'name' => 'layout_carousel_enable',
394 'operator' => '==',
395 'value' => 'yes',
396 ]
397 ],
398 ],
399 ]
400 );
401
402 $this->add_control(
403 'layout_carousel_variableWidth',
404 [
405 'label' => __( 'variableWidth', 'wpdirectorykit' ),
406 'type' => \Elementor\Controls_Manager::SWITCHER,
407 'label_on' => __( 'On', 'wpdirectorykit' ),
408 'label_off' => __( 'Off', 'wpdirectorykit' ),
409 'return_value' => 'yes',
410 'default' => '',
411 'conditions' => [
412 'terms' => [
413 [
414 'name' => 'layout_carousel_enable',
415 'operator' => '==',
416 'value' => 'yes',
417 ]
418 ],
419 ],
420 ]
421 );
422
423 $this->add_control(
424 'layout_carousel_is_infinite',
425 [
426 'label' => __( 'Infinite', 'wpdirectorykit' ),
427 'type' => \Elementor\Controls_Manager::SWITCHER,
428 'label_on' => __( 'On', 'wpdirectorykit' ),
429 'label_off' => __( 'Off', 'wpdirectorykit' ),
430 'return_value' => 'true',
431 'default' => 'true',
432 'conditions' => [
433 'terms' => [
434 [
435 'name' => 'layout_carousel_enable',
436 'operator' => '==',
437 'value' => 'yes',
438 ]
439 ],
440 ],
441 ]
442 );
443
444 $this->add_control(
445 'layout_carousel_is_autoplay',
446 [
447 'label' => __( 'Autoplay', 'wpdirectorykit' ),
448 'type' => \Elementor\Controls_Manager::SWITCHER,
449 'label_on' => __( 'On', 'wpdirectorykit' ),
450 'label_off' => __( 'Off', 'wpdirectorykit' ),
451 'return_value' => 'true',
452 'default' => '',
453 'conditions' => [
454 'terms' => [
455 [
456 'name' => 'layout_carousel_enable',
457 'operator' => '==',
458 'value' => 'yes',
459 ]
460 ],
461 ],
462 ]
463 );
464
465 $this->add_control(
466 'layout_carousel_columns',
467 [
468 'label' => __( 'Count grid', 'wpdirectorykit' ),
469 'type' => \Elementor\Controls_Manager::NUMBER,
470 'min' => 1,
471 'max' => 10,
472 'step' => 1,
473 'default' => 5,
474 'conditions' => [
475 'terms' => [
476 [
477 'name' => 'layout_carousel_enable',
478 'operator' => '==',
479 'value' => 'yes',
480 ]
481 ],
482 ],
483 ]
484 );
485
486 $this->add_control(
487 'layout_carousel_speed',
488 [
489 'label' => __( 'Speed', 'wpdirectorykit' ),
490 'type' => \Elementor\Controls_Manager::NUMBER,
491 'min' => 0,
492 'max' => 100000,
493 'step' => 100,
494 'default' => 500,
495 'conditions' => [
496 'terms' => [
497 [
498 'name' => 'layout_carousel_enable',
499 'operator' => '==',
500 'value' => 'yes',
501 ]
502 ],
503 ],
504 ]
505 );
506 $this->add_control(
507 'layout_carousel_autoplaySpeed',
508 [
509 'label' => __( 'Speed', 'wpdirectorykit' ),
510 'type' => \Elementor\Controls_Manager::NUMBER,
511 'min' => 0,
512 'max' => 100000,
513 'step' => 100,
514 'default' => 500,
515 'conditions' => [
516 'terms' => [
517 [
518 'name' => 'layout_carousel_enable',
519 'operator' => '==',
520 'value' => 'yes',
521 ]
522 ],
523 ],
524 ]
525 );
526
527 $this->add_control(
528 'layout_carousel_animation_style',
529 [
530 'label' => __( 'Animation Style', 'wpdirectorykit' ),
531 'type' => \Elementor\Controls_Manager::SELECT,
532 'default' => 'fade',
533 'options' => [
534 'slide' => __( 'Slide', 'wpdirectorykit' ),
535 'fade' => __( 'Fade', 'wpdirectorykit' ),
536 'fade_in_in' => __( 'Fade in', 'wpdirectorykit' ),
537 ],
538 'conditions' => [
539 'terms' => [
540 [
541 'name' => 'layout_carousel_enable',
542 'operator' => '==',
543 'value' => 'yes',
544 ]
545 ],
546 ],
547 ]
548 );
549
550 $this->add_control(
551 'layout_carousel_cssease',
552 [
553 'label' => __( 'cssEase ', 'wpdirectorykit' ),
554 'type' => \Elementor\Controls_Manager::SELECT,
555 'default' => 'linear',
556 'options' => [
557 'linear' => __( 'linear', 'wpdirectorykit' ),
558 'ease' => __( 'ease', 'wpdirectorykit' ),
559 'ease-in' => __( 'ease-in', 'wpdirectorykit' ),
560 'ease-out' => __( 'ease-out', 'wpdirectorykit' ),
561 'ease-in-out' => __( 'ease-in-out', 'wpdirectorykit' ),
562 'step-start' => __( 'step-start', 'wpdirectorykit' ),
563 'step-end' => __( 'step-end', 'wpdirectorykit' ),
564 ],
565 'conditions' => [
566 'terms' => [
567 [
568 'name' => 'layout_carousel_enable',
569 'operator' => '==',
570 'value' => 'yes',
571 ]
572 ],
573 ],
574 ]
575 );
576
577 $this->end_controls_section();
578 }
579
580 private function generate_controls_styles() {
581 $this->start_controls_section(
582 'styles_thmbn_section',
583 [
584 'label' => esc_html__('Main', 'wpdirectorykit'),
585 'tab' => Controls_Manager::TAB_STYLE,
586 ]
587 );
588
589 $this->add_responsive_control(
590 'row_gap_col',
591 [
592 'label' => __( 'Columns', 'wpdirectorykit' ),
593 'type' => Controls_Manager::SELECT,
594 'options' => [
595 '' => esc_html__('Default', 'wpdirectorykit'),
596 'auto' => esc_html__('Auto', 'wpdirectorykit'),
597 '100%' => '1',
598 '50%' => '2',
599 'calc(100% / 3)' => '3',
600 '25%' => '4',
601 '20%' => '5',
602 'auto_flexible' => 'auto flexible',
603 ],
604 'selectors_dictionary' => [
605 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
606 '100%' => 'width:100%;-webkit-flex:0 0 100%;flex:0 0 100%',
607 '50%' => 'width:50%;-webkit-flex:0 0 50%;flex:0 0 50%',
608 'calc(100% / 3)' => 'width:calc(100% / 3);-webkit-flex:0 0 calc(100% / 3);flex:0 0 calc(100% / 3)',
609 '25%' => 'width:25%;-webkit-flex:0 0 25%;flex:0 0 25%',
610 '20%' => 'width:20%;-webkit-flex:0 0 20%;flex:0 0 20%',
611 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
612 'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto',
613 ],
614 'selectors' => [
615 '{{WRAPPER}} .wdk-row .wdk-col' => '{{UNIT}}',
616 ],
617 'default' => '25%',
618 'separator' => 'before',
619 ]
620 );
621
622 $this->add_responsive_control(
623 'column_gap',
624 [
625 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
626 'type' => Controls_Manager::SLIDER,
627 'default' => [
628 'size' => 10,
629 ],
630 'range' => [
631 'px' => [
632 'min' => 0,
633 'max' => 60,
634 ],
635 ],
636 'selectors' => [
637 '{{WRAPPER}} .wdk-row .wdk-col' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};;',
638 '{{WRAPPER}} .wdk-row' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};',
639 ],
640 ]
641 );
642
643 $this->add_responsive_control(
644 'row_gap',
645 [
646 'label' => esc_html__('Rows Gap', 'wpdirectorykit'),
647 'type' => Controls_Manager::SLIDER,
648 'default' => [
649 'size' => 10,
650 ],
651 'range' => [
652 'px' => [
653 'min' => 0,
654 'max' => 60,
655 ],
656 ],
657 'selectors' => [
658 '{{WRAPPER}} .wdk-row .wdk-col' => 'margin-bottom: {{SIZE}}{{UNIT}};',
659 '{{WRAPPER}} .wdk-row' => 'margin-bottom: -{{SIZE}}{{UNIT}};',
660 ],
661 ]
662 );
663
664 $this->end_controls_section();
665
666 $this->start_controls_section(
667 'styles_thmbn_type',
668 [
669 'label' => esc_html__('Thumbnail', 'wpdirectorykit'),
670 'tab' => Controls_Manager::TAB_STYLE,
671 ]
672 );
673
674 $this->add_control(
675 'layout_image_type',
676 [
677 'label' => __( 'Thumbnail Type', 'wpdirectorykit' ),
678 'type' => \Elementor\Controls_Manager::SELECT,
679 'default' => 'icon',
680 'options' => [
681 'icon' => __( 'Icon', 'wpdirectorykit' ),
682 'image' => __( 'Image', 'wpdirectorykit' ),
683 ],
684 ]
685 );
686
687 $this->add_control(
688 'layout_image_design',
689 [
690 'label' => __( 'Size style thumbnail', 'wpdirectorykit' ),
691 'type' => \Elementor\Controls_Manager::SELECT,
692 'default' => 'none',
693 'options' => [
694 'none' => __( 'None', 'wpdirectorykit' ),
695 'contain' => __( 'Contain', 'wpdirectorykit' ),
696 'cover' => __( 'Cover', 'wpdirectorykit' ),
697 ],
698 'selectors' => [
699 '{{WRAPPER}} .wdk-categories-card .wdk-thumbnail .wdk-image' => 'object-fit: {{VALUE}}',
700 '{{WRAPPER}} .wdk-categories-card .wdk-thumbnail .wdk-icon' => 'object-fit: {{VALUE}}',
701 ],
702 ]
703 );
704
705 $selectors = array(
706 'normal' => '{{WRAPPER}} .wdk-categories-card .wdk-thumbnail',
707 );
708 $this->generate_renders_tabs($selectors, 'layout_image_dynamic', ['padding' ,'background','color']);
709
710 $this->add_responsive_control (
711 'styles_thmbn_des_height',
712 [
713 'label' => esc_html__('Height', 'wpdirectorykit'),
714 'type' => Controls_Manager::SLIDER,
715 'range' => [
716 'px' => [
717 'min' => 100,
718 'max' => 1500,
719 ],
720 'vw' => [
721 'min' => 0,
722 'max' => 100,
723 ],
724 ],
725 'size_units' => [ 'px', 'vw' ],
726 'default' => [
727 'size' => 350,
728 'unit' => 'px',
729 ],
730 'selectors' => [
731 '{{WRAPPER}} .wdk-categories-card .wdk-thumbnail .wdk-image' => 'height: {{SIZE}}{{UNIT}}',
732 '{{WRAPPER}} .wdk-categories-card .wdk-thumbnail .wdk-icon' => 'height: {{SIZE}}{{UNIT}}',
733 ],
734 'separator' => 'after',
735 ]
736 );
737
738 $this->end_controls_section();
739
740 $items = [
741 [
742 'key'=>'item_title',
743 'label'=> esc_html__('Item Title', 'wpdirectorykit'),
744 'selector'=>'.wdk-categories-grid .wdk-categories-card .wdk-title',
745 'selector_hover'=>'.wdk-categories-grid .wdk-categories-card%1$s .wdk-title',
746 'options'=>'full',
747 ],
748 [
749 'key'=>'card',
750 'label'=> esc_html__('Card', 'wpdirectorykit'),
751 'selector'=>'.wdk-categories-grid .wdk-categories-card',
752 'selector_hover'=>'.wdk-categories-grid .wdk-categories-card%1$s',
753 'options'=>'block',
754 ],
755 ];
756
757 foreach ($items as $item) {
758 $this->start_controls_section(
759 $item['key'].'_section',
760 [
761 'label' => $item['label'],
762 'tab' => Controls_Manager::TAB_STYLE,
763 ]
764 );
765 $this->add_responsive_control(
766 $item['key'].'_hide',
767 [
768 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
769 'type' => Controls_Manager::SWITCHER,
770 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
771 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
772 'return_value' => 'none',
773 'default' => '',
774 'selectors' => [
775 '{{WRAPPER}} '.$item['selector'] => 'display: {{VALUE}};',
776 ],
777 ]
778 );
779 $selectors = array(
780 'normal' => '{{WRAPPER}} '.$item['selector'],
781 'hover'=>'{{WRAPPER}} '.$item['selector_hover'],
782 );
783 $this->generate_renders_tabs($selectors, $item['key'].'_dynamic', $item['options']);
784
785 $this->end_controls_section();
786 }
787 }
788
789 private function generate_controls_content() {
790
791 }
792
793 public function enqueue_styles_scripts() {
794
795 wp_enqueue_style('wdk-categories-grid');
796 wp_enqueue_style('slick');
797 wp_enqueue_style('slick-theme');
798 wp_enqueue_script('slick');
799 }
800 }
801