PluginProbe ʕ •ᴥ•ʔ
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor / 4.0.2
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor v4.0.2
4.0.2 4.0.1 4.0.0 3.10.02 3.10.01 3.9.10 3.9.9 3.9.8 3.9.7 3.9.5 3.9.6 3.9.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.3.0 2.3.1 2.3.1.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.4.0 2.5.0 2.5.1 2.5.10 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.2 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.6.0 3.6.1 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.8.1 3.8.2 3.9.0 3.9.1 3.9.2 trunk 1.2.6 1.2.7 1.2.9 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.11 1.5.12 1.5.2 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.0.9.1 2.0.9.2 2.0.9.3
elementskit-lite / widgets / image-accordion / image-accordion.php
elementskit-lite / widgets / image-accordion Last commit date
image-accordion-handler.php 3 years ago image-accordion.php 1 week ago
image-accordion.php
1131 lines
1 <?php
2 namespace Elementor;
3
4 use \Elementor\ElementsKit_Widget_Image_Accordion_Handler as Handler;
5 use \ElementsKit_Lite\Modules\Controls\Controls_Manager as ElementsKit_Controls_Manager;
6
7 if ( ! defined( 'ABSPATH' ) ) exit;
8
9
10 class ElementsKit_Widget_Image_Accordion extends Widget_Base {
11 use \ElementsKit_Lite\Widgets\Widget_Notice;
12
13 public $base;
14
15 public function get_script_depends() {
16 return [ 'ekit-image-accordion'];
17 }
18
19 public function get_style_depends() {
20 return ['ekit-button','ekit-image-accordion'];
21 }
22
23 public function get_name() {
24 return Handler::get_name();
25 }
26
27 public function get_title() {
28 return Handler::get_title();
29 }
30
31 public function get_icon() {
32 return Handler::get_icon();
33 }
34
35 public function get_categories() {
36 return Handler::get_categories();
37 }
38
39 public function get_keywords() {
40 return Handler::get_keywords();
41 }
42
43 public function get_help_url() {
44 return 'https://wpmet.com/doc/image-accordion/';
45 }
46 protected function is_dynamic_content(): bool {
47 return false;
48 }
49
50 protected function register_controls() {
51
52 $this->start_controls_section(
53 'ekit_img_accordion_content_tab',
54 [
55 'label' => esc_html__('Content', 'elementskit-lite'),
56 'tab' => Controls_Manager::TAB_CONTENT,
57 ]
58 );
59 $repeater = new \Elementor\Repeater();
60
61 $repeater->add_control(
62 'ekit_img_accordion_active',
63 [
64 'label' => esc_html__('Active ? ', 'elementskit-lite'),
65 'type' => Controls_Manager::SWITCHER,
66 'default' => 'no',
67 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
68 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
69 ]
70 );
71
72 $repeater->add_control(
73 'ekit_img_accordion_bg',
74 [
75 'label' => esc_html__( 'Background Image', 'elementskit-lite' ),
76 'type' => Controls_Manager::MEDIA,
77 'dynamic' => [
78 'active' => true,
79 ],
80 'default' => [
81 'url' => Utils::get_placeholder_image_src(),
82 'id' => -1
83 ],
84 ]
85 );
86
87 $repeater->add_control(
88 'ekit_img_accordion_title',
89 [
90 'label' => esc_html__('Title', 'elementskit-lite'),
91 'type' => Controls_Manager::TEXT,
92 'dynamic' => [
93 'active' => true,
94 ],
95 'label_block' => true,
96 'default' => esc_html__('Image accordion Title', 'elementskit-lite'),
97 ]
98 );
99
100 $repeater->add_control(
101 'ekit_img_accordion_enable_icon',
102 [
103 'label' => esc_html__( 'Enable Icon', 'elementskit-lite' ),
104 'type' => Controls_Manager::SWITCHER,
105 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
106 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
107 'return_value' => 'yes',
108 'default' => '',
109 ]
110 );
111
112 $repeater->add_control(
113 'ekit_img_accordion_title_icons',
114 [
115 'label' => esc_html__('Icon for title', 'elementskit-lite'),
116 'type' => Controls_Manager::ICONS,
117 'fa4compatibility' => 'ekit_img_accordion_title_icon',
118 'default' => [
119 'value' => '',
120 ],
121 'condition' => [
122 'ekit_img_accordion_enable_icon' => 'yes',
123 ]
124 ]
125 );
126
127 $repeater->add_control(
128 'ekit_img_accordion_title_icon_position',
129 [
130 'label' => esc_html__( 'Icon Position', 'elementskit-lite' ),
131 'type' => Controls_Manager::SELECT,
132 'default' => 'left',
133 'options' => [
134 'left' => esc_html__( 'Before', 'elementskit-lite' ),
135 'right' => esc_html__( 'After', 'elementskit-lite' ),
136 ],
137 'condition' => [
138 'ekit_img_accordion_title_icons!' => '',
139 'ekit_img_accordion_enable_icon' => 'yes',
140 ],
141 ]
142 );
143
144 $repeater->add_control(
145 'ekit_img_accordion_enable_wrap_link',
146 [
147 'label' => esc_html__( 'Enable Wrap Link', 'elementskit-lite' ),
148 'type' => Controls_Manager::SWITCHER,
149 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
150 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
151 'return_value' => 'yes',
152 'default' => 'no',
153 'separator' => 'before',
154 ]
155 );
156
157 $repeater->add_control(
158 'ekit_img_accordion_wrap_link_url',
159 [
160 'label' => esc_html__('Wrap URL', 'elementskit-lite'),
161 'type' => Controls_Manager::URL,
162 'dynamic' => [
163 'active' => true,
164 ],
165 'condition' => [
166 'ekit_img_accordion_enable_wrap_link' => 'yes',
167 ],
168 ]
169 );
170
171 $repeater->add_control(
172 'ekit_img_accordion_enable_button',
173 [
174 'label' => esc_html__( 'Enable Button', 'elementskit-lite' ),
175 'type' => Controls_Manager::SWITCHER,
176 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
177 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
178 'return_value' => 'yes',
179 'default' => 'yes',
180 'separator' => 'before',
181 ]
182 );
183
184 $repeater->add_control(
185 'ekit_img_accordion_button_label',
186 [
187 'label' => esc_html__('Button Label', 'elementskit-lite'),
188 'type' => Controls_Manager::TEXT,
189 'dynamic' => [
190 'active' => true,
191 ],
192 'label_block' => true,
193 'default' => esc_html__('Read More','elementskit-lite'),
194 'condition' => [
195 'ekit_img_accordion_enable_button' => 'yes',
196 ],
197 ]
198 );
199
200 $repeater->add_control(
201 'ekit_img_accordion_button_url',
202 [
203 'label' => esc_html__('Button URL', 'elementskit-lite'),
204 'type' => Controls_Manager::URL,
205 'dynamic' => [
206 'active' => true,
207 ],
208 'condition' => [
209 'ekit_img_accordion_enable_button' => 'yes',
210 ],
211 ]
212 );
213
214 $repeater->add_control(
215 'ekit_img_accordion_enable_pupup',
216 [
217 'label' => esc_html__( 'Enable Popup', 'elementskit-lite' ),
218 'type' => Controls_Manager::SWITCHER,
219 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
220 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
221 'return_value' => 'yes',
222 'default' => '',
223 'separator' => 'before',
224 ]
225 );
226
227 $repeater->add_control(
228 'ekit_img_accordion_pup_up_icons',
229 [
230 'label' => esc_html__('Pupup Icon', 'elementskit-lite'),
231 'type' => Controls_Manager::ICONS,
232 'fa4compatibility' => 'ekit_img_accordion_pup_up_icon',
233 'default' => [
234 'value' => 'icon icon-plus',
235 'library' => 'ekiticons'
236 ],
237 'label_block' => true,
238 'condition' => [
239 'ekit_img_accordion_enable_pupup' => 'yes'
240 ]
241 ]
242 );
243
244 $repeater->add_control(
245 'ekit_img_accordion_enable_project_link',
246 [
247 'label' => esc_html__( 'Enable Project Link', 'elementskit-lite' ),
248 'type' => Controls_Manager::SWITCHER,
249 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
250 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
251 'return_value' => 'yes',
252 'separator' => 'before',
253 ]
254 );
255
256 $repeater->add_control(
257 'ekit_img_accordion_project_link',
258 [
259 'label' => esc_html__( 'Project Link', 'elementskit-lite' ),
260 'type' => Controls_Manager::URL,
261 'dynamic' => [
262 'active' => true,
263 ],
264 'placeholder' => esc_html__( 'https://wpmet.com', 'elementskit-lite' ),
265 'condition' => [
266 'ekit_img_accordion_enable_project_link' => 'yes'
267 ],
268 ]
269 );
270
271 $repeater->add_control(
272 'ekit_img_accordion_project_link_icons',
273 [
274 'label' => esc_html__('Project Link Icon', 'elementskit-lite'),
275 'type' => Controls_Manager::ICONS,
276 'fa4compatibility' => 'ekit_img_accordion_project_link_icon',
277 'default' => [
278 'value' => 'icon icon icon-link',
279 'library' => 'ekiticons'
280 ],
281 'label_block' => true,
282 'condition' => [
283 'ekit_img_accordion_enable_project_link' => 'yes'
284 ],
285 ]
286 );
287
288 $this->add_control(
289 'ekit_img_accordion_items',
290 [
291 'label' => esc_html__('Accordion Items', 'elementskit-lite'),
292 'type' => Controls_Manager::REPEATER,
293 'default' => [
294 [ 'ekit_img_accordion_title' => esc_html__('This is title','elementskit-lite') ],
295 [ 'ekit_img_accordion_icon' => esc_attr('icon icon-minus') ],
296 [ 'ekit_img_accordion_link' => esc_url('#') ],
297 [ 'ekit_img_accordion_button_label' => esc_html__('Read More','elementskit-lite') ],
298 ],
299 'fields' => $repeater->get_controls(),
300 'title_field' => '{{ ekit_img_accordion_title }}',
301 ]
302 );
303
304 $this->add_responsive_control(
305 'items_style',
306 [
307 'label' => esc_html__('Style', 'elementskit-lite'),
308 'type' => Controls_Manager::SELECT,
309 'options' => [
310 '' => esc_html__('Default', 'elementskit-lite'),
311 'horizontal' => esc_html__('Horizontal', 'elementskit-lite'),
312 'vertical' => esc_html__('Vertical', 'elementskit-lite'),
313 ],
314 'default' => 'horizontal',
315 'prefix_class' => 'ekit-image-accordion%s-',
316 ]
317 );
318
319 $this->add_control(
320 'active_behavior',
321 [
322 'label' => esc_html__('Active Behaivor', 'elementskit-lite'),
323 'type' => Controls_Manager::SELECT,
324 'options' => [
325 'click' => esc_html__('Click', 'elementskit-lite'),
326 'hover' => esc_html__('Hover', 'elementskit-lite'),
327 ],
328 'default' => 'click',
329 'prefix_class' => 'ekit-image-accordion-',
330 ]
331 );
332 $this->end_controls_section();
333
334 /** Tab Style (Image accordion General Style) */
335 $this->start_controls_section(
336 'ekit_img_accordion_general_settings',
337 [
338 'label' => esc_html__( 'General', 'elementskit-lite' ),
339 'tab' => Controls_Manager::TAB_STYLE
340 ]
341 );
342
343 $this->add_responsive_control(
344 'ekit_img_accordion_min_height',
345 [
346 'label' => esc_html__( 'Min Height', 'elementskit-lite' ),
347 'type' => Controls_Manager::SLIDER,
348 'size_units' => [ 'px' ],
349
350 'range' => [
351 'px' => [
352 'min' => 0,
353 'max' => 1000,
354 ],
355 ],
356 'default' => [
357 'unit' => 'px',
358 'size' => 460,
359 ],
360 'selectors' => [
361 '{{WRAPPER}} .elementskit-single-image-accordion' => 'min-height: {{SIZE}}{{UNIT}};',
362 '{{WRAPPER}} .elementskit-image-accordion-wraper' => 'height: {{SIZE}}{{UNIT}};',
363 ],
364 ]
365 );
366
367
368 $this->add_responsive_control(
369 'ekit_img_accordion_gutter',
370 [
371 'label' => esc_html__( 'Gutter', 'elementskit-lite' ),
372 'type' => Controls_Manager::SLIDER,
373 'range' => [
374 'px' => [
375 'min' => 0,
376 'max' => 100,
377 ],
378 ],
379 'selectors' => [
380 '{{WRAPPER}} .elementskit-image-accordion-wraper .elementskit-single-image-accordion' => 'margin-left: {{SIZE}}{{UNIT}}; margin-right: {{SIZE}}{{UNIT}};',
381 '{{WRAPPER}} .elementskit-image-accordion-wraper' => 'margin-left: -{{SIZE}}{{UNIT}}; margin-right: -{{SIZE}}{{UNIT}};',
382 ],
383 ]
384 );
385
386 $this->add_control(
387 'ekit_img_accordion_active_background_text',
388 [
389 'label' => esc_html__( 'Active Item Background', 'elementskit-lite' ),
390 'type' => Controls_Manager::HEADING,
391 'separator' => 'before'
392 ]
393 );
394
395 $this->add_group_control(
396 Group_Control_Background::get_type(),
397 array(
398 'name' => 'ekit_img_accordion_bg_active_color',
399 'selector' => '{{WRAPPER}} .elementskit-single-image-accordion:before',
400 )
401 );
402 $this->add_responsive_control(
403 'ekit_img_accordion_container_padding',
404 [
405 'label' => esc_html__( 'Padding', 'elementskit-lite' ),
406 'type' => Controls_Manager::DIMENSIONS,
407 'size_units' => [ 'px', 'em', '%' ],
408 'separator' => 'before',
409 'selectors' => [
410 '{{WRAPPER}} .elementskit-image-accordion-wraper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
411 ],
412 ]
413 );
414
415 $this->add_responsive_control(
416 'ekit_img_accordion_container_margin',
417 [
418 'label' => esc_html__( 'Margin', 'elementskit-lite' ),
419 'type' => Controls_Manager::DIMENSIONS,
420 'size_units' => [ 'px', 'em', '%' ],
421 'selectors' => [
422 '{{WRAPPER}} .elementskit-image-accordion-wraper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
423 ],
424 ]
425 );
426 $this->add_group_control(
427 Group_Control_Border::get_type(),
428 [
429 'name' => 'ekit_img_accordion_border_group',
430 'label' => esc_html__( 'Border', 'elementskit-lite' ),
431 'selector' => '{{WRAPPER}} .elementskit-image-accordion-wraper',
432 ]
433 );
434
435 $this->add_control(
436 'ekit_img_accordion_border_radius',
437 [
438 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ),
439 'type' => Controls_Manager::SLIDER,
440 'range' => [
441 'px' => [
442 'max' => 500,
443 ],
444 ],
445 'selectors' => [
446 '{{WRAPPER}} .elementskit-image-accordion-wraper' => 'border-radius: {{SIZE}}px;',
447 ],
448 ]
449 );
450 $this->add_group_control(
451 Group_Control_Box_Shadow::get_type(),
452 [
453 'name' => 'ekit_img_accordion_shadow',
454 'selector' => '{{WRAPPER}} .elementskit-image-accordion-wraper',
455 ]
456 );
457
458 $this->end_controls_section();
459
460
461 /** Tab Style (Image accordion Content Style) */
462 $this->start_controls_section(
463 'ekit_img_accordion_section_img_accordion_title_settings',
464 [
465 'label' => esc_html__( 'Title', 'elementskit-lite' ),
466 'tab' => Controls_Manager::TAB_STYLE
467 ]
468 );
469
470 $this->add_control(
471 'ekit_img_accordion_section_img_accordion_icon_title',
472 [
473 'label' => esc_html_x( 'Margin', 'Border Control', 'elementskit-lite' ),
474 'type' => Controls_Manager::DIMENSIONS,
475 'default' => [
476 'top' => '0',
477 'bottom' => '20',
478 'left' => '0',
479 'right' => '0',
480 'unit' => 'px',
481 ],
482 'selectors' => [
483 '{{WRAPPER}} .elementskit-single-image-accordion .elementskit-accordion-title-wraper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
484 ],
485 ]
486 );
487 $this->add_control(
488 'ekit_img_accordion_section_img_accordion_title_icon_spacing',
489 [
490 'label' => esc_html_x( 'Title Icon Spacing', 'Border Control', 'elementskit-lite' ),
491 'type' => Controls_Manager::DIMENSIONS,
492 'selectors' => [
493 '{{WRAPPER}} .elementskit-single-image-accordion .elementskit-accordion-title-wraper .icon-title > i, {{WRAPPER}} .elementskit-single-image-accordion .elementskit-accordion-title-wraper .icon-title > svg' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
494 ],
495 ]
496 );
497 $this->add_control(
498 'ekit_img_accordion_title_color',
499 [
500 'label' => esc_html__( 'Color', 'elementskit-lite' ),
501 'type' => Controls_Manager::COLOR,
502 'default' => '#fff',
503 'selectors' => [
504 '{{WRAPPER}} .elementskit-image-accordion-wraper .elementskit-accordion-title-wraper .elementskit-accordion-title ' => 'color: {{VALUE}};',
505 '{{WRAPPER}} .elementskit-image-accordion-wraper .elementskit-accordion-title-wraper .elementskit-accordion-title svg' => 'fill: {{VALUE}};',
506 ],
507 ]
508 );
509
510 $this->add_responsive_control(
511 'ekit_img_accordion_title_icon_size',
512 [
513 'label' => esc_html__( 'Icon Size', 'elementskit-lite' ),
514 'type' => Controls_Manager::SLIDER,
515 'size_units' => [ 'px', '%' ],
516 'range' => [
517 'px' => [
518 'min' => 1,
519 'max' => 100,
520 'step' => 5,
521 ],
522 '%' => [
523 'min' => 1,
524 'max' => 100,
525 ],
526 ],
527 'selectors' => [
528 '{{WRAPPER}} .elementskit-image-accordion-wraper .elementskit-accordion-title-wraper .elementskit-accordion-title i' => 'font-size: {{SIZE}}{{UNIT}};',
529 '{{WRAPPER}} .elementskit-image-accordion-wraper .elementskit-accordion-title-wraper .elementskit-accordion-title svg' => 'max-width: {{SIZE}}{{UNIT}}; height: auto',
530 ],
531 ]
532 );
533
534 $this->add_group_control(
535 Group_Control_Typography::get_type(),
536 [
537 'name' => 'ekit_img_accordion_title_typography_group',
538 'selector' => '{{WRAPPER}} .elementskit-image-accordion-wraper .elementskit-accordion-title-wraper .elementskit-accordion-title',
539 ]
540 );
541
542 $this->end_controls_section();
543
544 /** Tab Style (Image accordion Content Style) */
545 $this->start_controls_section(
546 'ekit_img_accordion_section_img_accordion_content_settings',
547 [
548 'label' => esc_html__( 'Content', 'elementskit-lite' ),
549 'tab' => Controls_Manager::TAB_STYLE
550 ]
551 );
552 $this->add_responsive_control(
553 'ekit_img_accordion_section_img_accordion_content_align',
554 [
555 'label' =>esc_html__( 'Alignment', 'elementskit-lite' ),
556 'type' => Controls_Manager::CHOOSE,
557 'options' => [
558 'left' => [
559 'title' =>esc_html__( 'Left', 'elementskit-lite' ),
560 'icon' => 'eicon-text-align-left',
561 ],
562 'center' => [
563 'title' =>esc_html__( 'Center', 'elementskit-lite' ),
564 'icon' => 'eicon-text-align-center',
565 ],
566 'right' => [
567 'title' =>esc_html__( 'Right', 'elementskit-lite' ),
568 'icon' => 'eicon-text-align-right',
569 ],
570 ],
571 'selectors' => [
572 '{{WRAPPER}} .elementskit-single-image-accordion .elementskit-accordion-content' => 'text-align: {{VALUE}};'
573 ],
574 'default' => 'center',
575 ]
576 );
577 $this->add_responsive_control(
578 'ekit_img_accordion_section_img_accordion_content_padding',
579 [
580 'label' =>esc_html__( 'Padding', 'elementskit-lite' ),
581 'type' => Controls_Manager::DIMENSIONS,
582 'size_units' => [ 'px', 'em', '%' ],
583 'selectors' => [
584 '{{WRAPPER}} .elementskit-single-image-accordion .elementskit-accordion-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
585 ],
586 ]
587 );
588
589 $this->add_responsive_control(
590 'ekit_img_accordion_section_img_accordion_content_position',
591 [
592 'label' => esc_html__( 'Vertical Position', 'elementskit-lite' ),
593 'type' => Controls_Manager::CHOOSE,
594 'label_block' => false,
595 'options' => [
596 'flex-start' => [
597 'title' => esc_html__( 'Top', 'elementskit-lite' ),
598 'icon' => 'eicon-v-align-top',
599 ],
600 'center' => [
601 'title' => esc_html__( 'Center', 'elementskit-lite' ),
602 'icon' => 'eicon-v-align-middle',
603 ],
604 'flex-end' => [
605 'title' => esc_html__( 'Bottom', 'elementskit-lite' ),
606 'icon' => 'eicon-v-align-bottom',
607 ],
608 ],
609 'default' => 'center',
610 'selectors' => [
611 '{{WRAPPER}} .elementskit-image-accordion-wraper .elementskit-single-image-accordion' => 'align-items: {{VALUE}}',
612 ],
613 ]
614 );
615
616
617 $this->end_controls_section();
618
619 // Button
620 $this->start_controls_section(
621 'ekit_img_accordion_button_style_settings',
622 [
623 'label' => esc_html__( 'Button', 'elementskit-lite' ),
624 'tab' => Controls_Manager::TAB_STYLE,
625 ]
626 );
627
628 $this->add_responsive_control(
629 'ekit_img_accordion_text_padding',
630 [
631 'label' =>esc_html__( 'Padding', 'elementskit-lite' ),
632 'type' => Controls_Manager::DIMENSIONS,
633 'size_units' => [ 'px', 'em', '%' ],
634 'default' => [
635 'top' => 15,
636 'right' => 20,
637 'bottom' => 15,
638 'left' => 20,
639 'unit' => 'px',
640 'isLinked' => true,
641 ],
642 'selectors' => [
643 '{{WRAPPER}} .elementskit-accordion-content .elementskit-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
644 ],
645 ]
646 );
647
648 $this->add_group_control(
649 Group_Control_Typography::get_type(),
650 [
651 'name' => 'ekit_img_accordion_btn_typography',
652 'label' =>esc_html__( 'Typography', 'elementskit-lite' ),
653 'selector' => '{{WRAPPER}} .elementskit-accordion-content .elementskit-btn',
654 ]
655 );
656
657 $this->start_controls_tabs( 'ekit_img_accordion_tabs_button_style' );
658
659 $this->start_controls_tab(
660 'ekit_img_accordion_tab_button_normal',
661 [
662 'label' =>esc_html__( 'Normal', 'elementskit-lite' ),
663 ]
664 );
665
666 $this->add_control(
667 'ekit_img_accordion_btn_text_color',
668 [
669 'label' =>esc_html__( 'Text Color', 'elementskit-lite' ),
670 'type' => Controls_Manager::COLOR,
671 'default' => '#ffffff',
672 'selectors' => [
673 '{{WRAPPER}} .elementskit-accordion-content .elementskit-btn' => 'color: {{VALUE}};',
674 ],
675 ]
676 );
677 $this->add_group_control(
678 Group_Control_Background::get_type(),
679 array(
680 'name' => 'ekit_img_accordion_btn_bg_color_group',
681 'label' => esc_html__( 'Background', 'elementskit-lite' ),
682 'selector' => '{{WRAPPER}} .elementskit-accordion-content .elementskit-btn',
683 'fields_options' => [
684 'background' => [
685 'color' => [
686 'default' => '#fff'
687 ],
688 ],
689
690 ],
691
692 )
693 );
694
695 $this->add_control(
696 'ekit_img_accordion_btn_border_color',
697 [
698 'label' => esc_html__( 'Border', 'elementskit-lite' ),
699 'type' => Controls_Manager::HEADING,
700 'separator' => 'before',
701
702 ]
703 );
704
705 $this->add_group_control(
706 Group_Control_Border::get_type(),
707 [
708 'name' => 'ekit_img_accordion_btn_border_group',
709 'label' => esc_html__( 'Border', 'elementskit-lite' ),
710 'selector' => '{{WRAPPER}} .elementskit-accordion-content .elementskit-btn',
711 'fields_options' => [
712 'border' => [
713 'default' => 'solid',
714 ],
715 'width' => [
716 'default' => [
717 'top' => '1',
718 'right' => '1',
719 'bottom' => '1',
720 'left' => '1',
721 'unit' => 'px'
722 ],
723 ],
724 'color' => [
725 'default' => '#ffffff',
726 ],
727 ],
728 ]
729 );
730 $this->add_control(
731 'ekit_img_accordion_btn_border_radius',
732 [
733 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ),
734 'type' => Controls_Manager::DIMENSIONS,
735 'size_units' => [ 'px', '%' ],
736 'default' => ['top' => '5', 'bottom' => '5', 'left' => '5', 'right' => '5', 'unit' => 'px'],
737 'selectors' => [
738 '{{WRAPPER}} .elementskit-accordion-content .elementskit-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
739 ],
740 ]
741 );
742
743 $this->end_controls_tab();
744
745 $this->start_controls_tab(
746 'ekit_img_accordion_btn_tab_button_hover',
747 [
748 'label' =>esc_html__( 'Hover', 'elementskit-lite' ),
749 ]
750 );
751
752 $this->add_control(
753 'ekit_img_accordion_btn_hover_color',
754 [
755 'label' =>esc_html__( 'Text Color', 'elementskit-lite' ),
756 'type' => Controls_Manager::COLOR,
757 'default' => '#fff',
758 'selectors' => [
759 '{{WRAPPER}} .elementskit-accordion-content .elementskit-btn:hover' => 'color: {{VALUE}};',
760 ],
761 ]
762 );
763
764 $this->add_group_control(
765 Group_Control_Background::get_type(),
766 array(
767 'name' => 'ekit_img_accordion_btn_bg_hover_color_group',
768 'selector' => '{{WRAPPER}} .elementskit-accordion-content .elementskit-btn:hover',
769 )
770 );
771 $this->add_control(
772 'ekit_img_accordion_btn_border_color_hover',
773 [
774 'label' => esc_html__( 'Border', 'elementskit-lite' ),
775 'type' => Controls_Manager::HEADING,
776 'separator' => 'before',
777 ]
778 );
779
780 $this->add_group_control(
781 Group_Control_Border::get_type(),
782 [
783 'name' => 'ekit_img_accordion_btn_border_hover_group',
784 'label' => esc_html__( 'Border', 'elementskit-lite' ),
785 'selector' => '{{WRAPPER}} .elementskit-accordion-content .elementskit-btn:hover',
786 ]
787 );
788 $this->add_control(
789 'btn_border_radius_hover',
790 [
791 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ),
792 'type' => Controls_Manager::DIMENSIONS,
793 'size_units' => [ 'px', '%' ],
794 'selectors' => [
795 '{{WRAPPER}} .elementskit-accordion-content .elementskit-btn:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
796 ],
797 ]
798 );
799 $this->end_controls_tab();
800 $this->end_controls_tabs();
801 $this->end_controls_section();
802 // PopUp
803
804 $this->start_controls_section(
805 'ekit_img_accordion_style_section',
806 [
807 'label' => esc_html__( 'Action Icon', 'elementskit-lite' ),
808 'tab' => Controls_Manager::TAB_STYLE,
809 ]
810 );
811
812 $this->add_control(
813 'actions_width',
814 [
815 'label' => esc_html__( 'Width', 'elementskit-lite' ),
816 'type' => Controls_Manager::SLIDER,
817 'selectors' => [
818 '{{WRAPPER}} .ekit-image-accordion-actions > a' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
819 ]
820 ]
821 );
822
823 $this->add_control(
824 'ekit_img_accordion_section_img_accordion_icon_left_spacing',
825 [
826 'label' => esc_html__( 'Icon Left Spacing', 'elementskit-lite' ),
827 'type' => Controls_Manager::SLIDER,
828 'range' => [
829 'px' => [
830 'min' => 0,
831 'max' => 100,
832 ],
833 ],
834 'selectors' => [
835 '{{WRAPPER}} .elementskit-single-image-accordion .elementskit-icon-wraper > a:not(:last-child)' => 'margin-right: {{SIZE}}px',
836 ],
837 ]
838 );
839
840 $this->add_control(
841 'ekit_img_accordion_section_img_accordion_icon_spacing',
842 [
843 'label' => esc_html_x( 'Icon Container Spacing', 'Border Control', 'elementskit-lite' ),
844 'type' => Controls_Manager::DIMENSIONS,
845 'selectors' => [
846 '{{WRAPPER}} .elementskit-single-image-accordion .elementskit-icon-wraper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
847 ],
848 ]
849 );
850
851 $this->add_control(
852 'actions_border_width',
853 [
854 'label' => esc_html__( 'Border Width', 'elementskit-lite' ),
855 'type' => Controls_Manager::NUMBER,
856 'placeholder' => '1',
857 'selectors' => [
858 '{{WRAPPER}} .ekit-image-accordion-actions > a' => 'border-width: {{VALUE}}px;',
859 ],
860 ]
861 );
862
863 $this->start_controls_tabs('ekit_img_accordion_pup_up_style_tabs');
864
865 $this->start_controls_tab(
866 'ekit_img_accordion_pupup_normal_tab',
867 [
868 'label' => esc_html__( 'Normal', 'elementskit-lite' ),
869 ]
870 );
871 $this->add_control(
872 'ekit_img_accordion_pup_up_icon_color',
873 [
874 'label' => esc_html__( 'Popup Icon Color', 'elementskit-lite' ),
875 'type' => Controls_Manager::COLOR,
876 'selectors' => [
877 '{{WRAPPER}} .elementskit-icon-wraper a:first-child' => 'color: {{VALUE}};',
878 '{{WRAPPER}} .elementskit-icon-wraper a:first-child svg path' => 'fill: {{VALUE}};',
879 ],
880 ]
881 );
882
883 $this->add_control(
884 'ekit_img_accordion_pup_up_project_color',
885 [
886 'label' => esc_html__( 'Link Icon Color', 'elementskit-lite' ),
887 'type' => Controls_Manager::COLOR,
888 'selectors' => [
889 '{{WRAPPER}} .elementskit-icon-wraper a:last-child' => 'color: {{VALUE}};',
890 '{{WRAPPER}} .elementskit-icon-wraper a:last-child svg path' => 'fill: {{VALUE}};',
891 ],
892 ]
893 );
894
895 $this->add_control(
896 'action_btn_bg',
897 [
898 'label' => esc_html__( 'Background Color', 'elementskit-lite' ),
899 'type' => Controls_Manager::COLOR,
900 'selectors' => [
901 '{{WRAPPER}} .ekit-image-accordion-actions > a' => 'background-color: {{VALUE}}; border-color: {{VALUE}};',
902 ],
903 ]
904 );
905
906 $this->end_controls_tab();
907
908 $this->start_controls_tab(
909 'ekit_img_accordion_pup_up_hover_tab',
910 [
911 'label' => esc_html__( 'Hover', 'elementskit-lite' ),
912 ]
913 );
914
915 $this->add_control(
916 'ekit_img_accordion_pup_up_icon_color_hover',
917 [
918 'label' => esc_html__( 'Popup Icon color', 'elementskit-lite' ),
919 'type' => Controls_Manager::COLOR,
920 'selectors' => [
921 '{{WRAPPER}} .elementskit-icon-wraper a:first-child:hover' => 'color: {{VALUE}}',
922 '{{WRAPPER}} .elementskit-icon-wraper a:first-child:hover svg path' => 'fill: {{VALUE}};',
923 ],
924 ]
925 );
926
927 $this->add_control(
928 'ekit_img_accordion_pup_up_project_color_hover',
929 [
930 'label' => esc_html__( 'Link Icon color', 'elementskit-lite' ),
931 'type' => Controls_Manager::COLOR,
932 'selectors' => [
933 '{{WRAPPER}} .elementskit-icon-wraper a:last-child:hover' => 'color: {{VALUE}};',
934 '{{WRAPPER}} .elementskit-icon-wraper a:last-child:hover svg path' => 'fill: {{VALUE}};',
935 ],
936 ]
937 );
938
939 $this->add_control(
940 'action_btn_bg_hover',
941 [
942 'label' => esc_html__( 'Background Color (Hover)', 'elementskit-lite' ),
943 'type' => Controls_Manager::COLOR,
944 'selectors' => [
945 '{{WRAPPER}} .ekit-image-accordion-actions > a:hover' => 'background-color: {{VALUE}}; border-color: {{VALUE}};',
946 ],
947 ]
948 );
949
950 $this->end_controls_tab();
951
952 $this->end_controls_tabs();
953
954 $this->end_controls_section();
955
956 $this->insert_pro_message();
957 }
958
959 protected function render( ) {
960 echo '<div class="ekit-wid-con" >';
961 $this->render_raw();
962 echo '</div>';
963 }
964
965 protected function render_raw( ) {
966 $settings = $this->get_settings_for_display();
967 extract($settings);
968 ?>
969 <div class="ekit-image-accordion elementskit-image-accordion-wraper">
970 <?php foreach ( $ekit_img_accordion_items as $key => $item ) :
971
972 $this->add_render_attribute( 'wrap-input-' . $key,[
973 'type' => 'radio',
974 'name' => 'ekit_ia_' . $this->get_id(),
975 'id' => 'ekit_ia_' . $this->get_id() .'_'. $key,
976 'class' => 'elementskit-single-image-accordion--input',
977 'aria-label' => ( '' !== $item['ekit_img_accordion_title'] ) ? $item['ekit_img_accordion_title'] : sprintf( esc_attr__( 'Item %d', 'elementskit-lite' ), $key + 1 ),
978 ] );
979
980 if($item['ekit_img_accordion_active'] == 'yes') {
981 $this->add_render_attribute( 'wrap-input-' . $key, 'checked', 'checked' );
982 }
983
984 $this->add_render_attribute( 'wrap-link-' . $key, [
985 'for' => 'ekit_ia_' . $this->get_id() .'_'. $key,
986 'class' => 'elementskit-single-image-accordion ekit-image-accordion-item',
987 'style' => 'background-image: url('.esc_url($item['ekit_img_accordion_bg']['url']).')',
988 ] );
989
990 // enabling wrap link
991 if(isset($item['ekit_img_accordion_enable_wrap_link']) && $item['ekit_img_accordion_enable_wrap_link'] == 'yes') {
992 $wrap_link = $item['ekit_img_accordion_wrap_link_url'] ?? [];
993 $wrap_link['url'] = !empty($wrap_link['url']) ? esc_url($wrap_link['url']) : '';
994
995 $this->add_render_attribute( 'wrap-link-' . $key, 'data-link', wp_json_encode($wrap_link) );
996 $this->add_render_attribute( 'wrap-link-' . $key, 'data-behavior', $active_behavior );
997 $this->add_render_attribute( 'wrap-link-' . $key, 'data-active', $item['ekit_img_accordion_active'] );
998 }
999 ?>
1000 <input <?php $this->print_render_attribute_string( 'wrap-input-' . $key ); ?>>
1001 <label <?php $this->print_render_attribute_string( 'wrap-link-' . $key ); ?>>
1002 <span class="elementskit-accordion-content">
1003 <?php if($item['ekit_img_accordion_enable_pupup'] == 'yes' || $item['ekit_img_accordion_enable_project_link'] == 'yes') {
1004 if (!empty($item['ekit_img_accordion_project_link']['url'])) {
1005 $this->add_link_attributes( 'projectlink', $item['ekit_img_accordion_project_link'] );
1006 }
1007 ?>
1008 <span class="elementskit-icon-wraper ekit-image-accordion-actions">
1009 <?php if($item['ekit_img_accordion_enable_pupup'] == 'yes') {
1010
1011 $this->add_lightbox_data_attributes( 'link' . $key,
1012 $item['ekit_img_accordion_bg']['id'],
1013 $item['ekit_img_accordion_enable_pupup'],
1014 $this->get_id()
1015 );
1016
1017 $this->add_render_attribute( 'link' . $key,
1018 [
1019 'href' => esc_url($item['ekit_img_accordion_bg']['url']),
1020 'aria-label' => esc_attr__( 'View image', 'elementskit-lite' ),
1021 'class' => "icon-outline circle",
1022 ]
1023 );
1024 ?>
1025 <a <?php $this->print_render_attribute_string( 'link' . $key ); ?>>
1026 <?php
1027 $migrated = isset( $item['__fa4_migrated']['ekit_img_accordion_pup_up_icons'] );
1028 // Check if its a new widget without previously selected icon using the old Icon control
1029 $is_new = empty( $item['ekit_img_accordion_pup_up_icon'] );
1030 if ( $is_new || $migrated ) {
1031
1032 // new icon
1033 Icons_Manager::render_icon( $item['ekit_img_accordion_pup_up_icons'], [ 'aria-hidden' => 'true'] );
1034 } else {
1035 ?>
1036 <i class="<?php echo esc_attr($item['ekit_img_accordion_pup_up_icon']); ?>" aria-hidden="true"></i>
1037 <?php
1038 }
1039 ?>
1040 </a>
1041 <?php } ?>
1042 <?php if($item['ekit_img_accordion_enable_project_link'] == 'yes') {
1043 if ( ! empty( $item['ekit_img_accordion_project_link']['url'] ) ) {
1044 $this->add_link_attributes( 'button-2' . $key, $item['ekit_img_accordion_project_link'] );
1045 $this->add_render_attribute( 'button-2' . $key, ['role' => "link", 'aria-label' => esc_attr__( 'View project', 'elementskit-lite' )] );
1046 }
1047 ?>
1048 <a <?php $this->print_render_attribute_string( 'button-2' . esc_attr($key) ); ?> class="icon-outline circle">
1049 <?php
1050 $migrated = isset( $item['__fa4_migrated']['ekit_img_accordion_project_link_icons'] );
1051 // Check if its a new widget without previously selected icon using the old Icon control
1052 $is_new = empty( $item['ekit_img_accordion_project_link_icon'] );
1053 if ( $is_new || $migrated ) {
1054
1055 // new icon
1056 Icons_Manager::render_icon( $item['ekit_img_accordion_project_link_icons'], [ 'aria-hidden' => 'true'] );
1057 } else {
1058 ?>
1059 <i class="<?php echo esc_attr($item['ekit_img_accordion_project_link_icon']); ?>" aria-hidden="true"></i>
1060 <?php
1061 }
1062 ?>
1063 </a>
1064 <?php } ?>
1065 </span>
1066 <?php } ?>
1067 <span class="elementskit-accordion-title-wraper">
1068 <span class="elementskit-accordion-title <?php echo esc_attr($item['ekit_img_accordion_title_icons'] != '') ? 'icon-title' : ''?>">
1069 <?php if($item['ekit_img_accordion_enable_icon'] == 'yes'): ?>
1070 <?php if($item['ekit_img_accordion_title_icon_position'] == 'left'): ?>
1071 <!-- same-1 -->
1072 <?php
1073
1074 $migrated = isset( $item['__fa4_migrated']['ekit_img_accordion_title_icons'] );
1075 // Check if its a new widget without previously selected icon using the old Icon control
1076 $is_new = empty( $item['ekit_img_accordion_title_icon'] );
1077 if ( $is_new || $migrated ) {
1078
1079 // new icon
1080 Icons_Manager::render_icon( $item['ekit_img_accordion_title_icons'], [ 'aria-hidden' => 'true'] );
1081 } else {
1082 ?>
1083 <i class="<?php echo esc_attr($item['ekit_img_accordion_title_icon']); ?>" aria-hidden="true"></i>
1084 <?php
1085 }
1086 ?>
1087 <?php endif; ?>
1088 <?php endif; ?>
1089
1090 <?php echo esc_html($item['ekit_img_accordion_title']); ?>
1091
1092 <?php if($item['ekit_img_accordion_enable_icon'] == 'yes'): ?>
1093 <?php if($item['ekit_img_accordion_title_icon_position'] == 'right'): ?>
1094 <!-- same-1 -->
1095 <?php
1096
1097 $migrated = isset( $item['__fa4_migrated']['ekit_img_accordion_title_icons'] );
1098 // Check if its a new widget without previously selected icon using the old Icon control
1099 $is_new = empty( $item['ekit_img_accordion_title_icon'] );
1100 if ( $is_new || $migrated ) {
1101
1102 // new icon
1103 Icons_Manager::render_icon( $item['ekit_img_accordion_title_icons'], [ 'aria-hidden' => 'true'] );
1104 } else {
1105 ?>
1106 <i class="<?php echo esc_attr($item['ekit_img_accordion_title_icon']); ?>" aria-hidden="true"></i>
1107 <?php
1108 }
1109 ?>
1110 <?php endif; ?>
1111 <?php endif; ?>
1112 </span>
1113 </span>
1114 <?php if($item['ekit_img_accordion_enable_button'] == 'yes') :
1115 if ( ! empty( $item['ekit_img_accordion_button_url']['url'] ) ) {
1116 $this->add_link_attributes( 'button-' . $key, $item['ekit_img_accordion_button_url'] );
1117 }
1118 ?>
1119 <span class="elementskit-btn-wraper">
1120 <a class="ekit-image-accordion--btn elementskit-btn whitespace--normal" <?php $this->print_render_attribute_string( 'button-' . esc_attr($key) ); ?>>
1121 <?php echo esc_html($item['ekit_img_accordion_button_label']); ?>
1122 </a>
1123 </span>
1124 <?php endif; ?>
1125 </span>
1126 </label>
1127 <?php endforeach; ?>
1128 </div>
1129 <?php }
1130 }
1131