PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.0.7
Easy Elements for Elementor – Addons & Website Templates v1.0.7
1.5.3 1.5.2 1.5.1 1.5.0 1.4.9 1.4.6 1.4.7 1.4.8 1.4.5 1.4.4 1.4.3 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.7 1.3.8 1.3.9 1.4.0 All 47 releases
← All changes | widgets/tab/tab.php +838 -827 1.5.31.0.7 View file →
@@ -1,827 +1,838 @@
1 -<?php
2 -namespace Easyel\EasyElements\Widgets;
3 -if ( ! defined( 'ABSPATH' ) ) {
4 - exit;
5 -}
6 -class Easyel_Tab_Widget extends \Elementor\Widget_Base {
7 - public function get_name() {
8 - return 'eel-tab';
9 - }
10 -
11 - public function get_title() {
12 - return esc_html__( 'Tabs', 'easy-elements' );
13 - }
14 -
15 - public function get_icon() {
16 - return 'easyicon easyelIcon-tab';
17 - }
18 -
19 - public function get_categories() {
20 - return [ 'easyelements_category' ];
21 - }
22 -
23 - public function get_keywords() {
24 - return [ 'tab', 'link', 'click', 'text' ];
25 - }
26 -
27 - public function get_style_depends() {
28 - return [
29 - 'eel-tab',
30 - ];
31 - }
32 -
33 - public function get_script_depends() {
34 - return [
35 - 'eel-tab',
36 - ];
37 - }
38 -
39 - protected function register_controls() {
40 -
41 - $this->start_controls_section(
42 - 'tabs_section',
43 - [
44 - 'label' => esc_html__( 'Tabs Settings', 'easy-elements' ),
45 - 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
46 - ]
47 - );
48 -
49 - $repeater = new \Elementor\Repeater();
50 -
51 - $repeater->add_control(
52 - 'tab_title',
53 - [
54 - 'label' => esc_html__( 'Tab Title', 'easy-elements' ),
55 - 'type' => \Elementor\Controls_Manager::TEXT,
56 - 'default' => esc_html__( 'Tab Title', 'easy-elements' ),
57 - 'label_block' => true,
58 - ]
59 - );
60 -
61 - $repeater->add_control(
62 - 'tab_title_icon_image_type',
63 - [
64 - 'label' => esc_html__( 'Icon / Image', 'easy-elements' ),
65 - 'type' => \Elementor\Controls_Manager::SELECT,
66 - 'options' => [
67 - 'none' => esc_html__( 'None', 'easy-elements' ),
68 - 'icon' => esc_html__( 'Icon', 'easy-elements' ),
69 - 'image' => esc_html__( 'Image', 'easy-elements' ),
70 - ],
71 - 'default' => 'icon',
72 - ]
73 - );
74 -
75 - $repeater->add_control(
76 - 'tab_icon',
77 - [
78 - 'label' => esc_html__( 'Icon', 'easy-elements' ),
79 - 'type' => \Elementor\Controls_Manager::ICONS,
80 - 'label_block' => true,
81 - 'default' => [
82 - 'value' => 'far fa-heart',
83 - 'library' => 'fa-regular',
84 - ],
85 - 'condition' => [
86 - 'tab_title_icon_image_type' => 'icon',
87 - ],
88 - ]
89 - );
90 -
91 - $repeater->add_control(
92 - 'tab_image',
93 - [
94 - 'label' => esc_html__( 'Image', 'easy-elements' ),
95 - 'type' => \Elementor\Controls_Manager::MEDIA,
96 - 'default' => [
97 - 'url' => \Elementor\Utils::get_placeholder_image_src(),
98 - ],
99 - 'condition' => [
100 - 'tab_title_icon_image_type' => 'image',
101 - ],
102 - ]
103 - );
104 -
105 -
106 - $repeater->add_control(
107 - 'content_title',
108 - [
109 - 'label' => esc_html__( 'Content Title', 'easy-elements' ),
110 - 'type' => \Elementor\Controls_Manager::TEXT,
111 - 'default' => esc_html__( 'Your Title Here', 'easy-elements' ),
112 - 'label_block' => true,
113 - ]
114 - );
115 -
116 - $repeater->add_control(
117 - 'content_description',
118 - [
119 - 'label' => esc_html__( 'Description', 'easy-elements' ),
120 - 'type' => \Elementor\Controls_Manager::WYSIWYG,
121 - 'default' => esc_html__( 'Your description here.', 'easy-elements' ),
122 - ]
123 - );
124 -
125 - $repeater->add_control(
126 - 'read_more_text',
127 - [
128 - 'label' => esc_html__( 'Button Text', 'easy-elements' ),
129 - 'type' => \Elementor\Controls_Manager::TEXT,
130 - 'default' => esc_html__( 'Let\'s find out', 'easy-elements' ),
131 - ]
132 - );
133 -
134 - $repeater->add_control(
135 - 'read_more_link',
136 - [
137 - 'label' => esc_html__( 'Button URL', 'easy-elements' ),
138 - 'type' => \Elementor\Controls_Manager::URL,
139 - 'placeholder' => 'https://your-link.com',
140 - ]
141 - );
142 -
143 - $this->add_control(
144 - 'tabs',
145 - [
146 - 'label' => esc_html__( 'Tabs Items', 'easy-elements' ),
147 - 'type' => \Elementor\Controls_Manager::REPEATER,
148 - 'fields' => $repeater->get_controls(),
149 - 'default' => [
150 - [
151 - 'tab_title' => 'Our Company',
152 - 'content_title' => '',
153 - 'content_description' => 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using Content here, content here, making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for lorem ipsum will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose',
154 - 'read_more_text' => '',
155 - 'read_more_link' => ['url' => '#'],
156 - ],
157 - [
158 - 'tab_title' => 'Our Mission',
159 - 'content_title' => '',
160 - 'content_description' => 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using Content here, content here, making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for lorem ipsum will uncover',
161 - 'read_more_text' => '',
162 - 'read_more_link' => ['url' => '#'],
163 - ],
164 - [
165 - 'tab_title' => 'Our Vision',
166 - 'content_title' => '',
167 - 'content_description' => 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using Content here, content here, making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for lorem ipsum will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters,',
168 - 'read_more_text' => '',
169 - 'read_more_link' => ['url' => '#'],
170 - ],
171 - ],
172 - 'title_field' => '{{{ tab_title }}}',
173 - ]
174 - );
175 -
176 - $this->end_controls_section();
177 -
178 -
179 - $this->start_controls_section(
180 - 'tabs_nav_section',
181 - [
182 - 'label' => esc_html__( 'Tab Title Settings', 'easy-elements' ),
183 - 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
184 - ]
185 - );
186 -
187 - $this->add_control(
188 - 'tab_icon_position',
189 - [
190 - 'label' => esc_html__( 'Icon Position', 'easy-elements' ),
191 - 'type' => \Elementor\Controls_Manager::CHOOSE,
192 - 'default' => 'left',
193 - 'options' => [
194 - 'left' => [
195 - 'title' => esc_html__( 'Left', 'easy-elements' ),
196 - 'icon' => 'eicon-h-align-left',
197 - ],
198 - 'top' => [
199 - 'title' => esc_html__( 'Top', 'easy-elements' ),
200 - 'icon' => 'eicon-v-align-top',
201 - ],
202 - 'right' => [
203 - 'title' => esc_html__( 'Right', 'easy-elements' ),
204 - 'icon' => 'eicon-h-align-right',
205 - ],
206 - ],
207 - 'toggle' => false,
208 - ]
209 - );
210 -
211 - $this->add_control(
212 - 'tab_layout_direction',
213 - [
214 - 'label' => esc_html__( 'Layout', 'easy-elements' ),
215 - 'type' => \Elementor\Controls_Manager::CHOOSE,
216 - 'default' => 'top',
217 - 'options' => [
218 - 'left' => [
219 - 'title' => esc_html__( 'Left', 'easy-elements' ),
220 - 'icon' => 'eicon-h-align-left',
221 - ],
222 - 'top' => [
223 - 'title' => esc_html__( 'Top', 'easy-elements' ),
224 - 'icon' => 'eicon-v-align-top',
225 - ],
226 - 'right' => [
227 - 'title' => esc_html__( 'Right', 'easy-elements' ),
228 - 'icon' => 'eicon-h-align-right',
229 - ],
230 - ],
231 - 'toggle' => false,
232 - ]
233 - );
234 -
235 - $this->end_controls_section();
236 -
237 - // Style Tab - Tab Titles
238 - $this->start_controls_section(
239 - 'tab_title_style_section',
240 - [
241 - 'label' => esc_html__( 'Tab Nav', 'easy-elements' ),
242 - 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
243 - ]
244 - );
245 -
246 - $this->add_group_control(
247 - \Elementor\Group_Control_Typography::get_type(),
248 - [
249 - 'name' => 'tab_title_typography',
250 - 'selector' => '{{WRAPPER}} .ee-tab-title-text',
251 - ]
252 - );
253 -
254 - $this->start_controls_tabs( 'tab_title_colors' );
255 -
256 - $this->start_controls_tab(
257 - 'tab_title_normal',
258 - [
259 - 'label' => esc_html__( 'Normal', 'easy-elements' ),
260 - ]
261 - );
262 -
263 - $this->add_control(
264 - 'tab_title_color',
265 - [
266 - 'label' => esc_html__( 'Text Color', 'easy-elements' ),
267 - 'type' => \Elementor\Controls_Manager::COLOR,
268 - 'selectors' => [
269 - '{{WRAPPER}} .ee-tab-title-text' => 'color: {{VALUE}}',
270 - ],
271 - ]
272 - );
273 -
274 - $this->add_control(
275 - 'tab_title_bg_color',
276 - [
277 - 'label' => esc_html__( 'Background Color', 'easy-elements' ),
278 - 'type' => \Elementor\Controls_Manager::COLOR,
279 - 'selectors' => [
280 - '{{WRAPPER}} .eel-tab-titles li' => 'background-color: {{VALUE}}',
281 - ],
282 - 'separator' => 'before',
283 - ]
284 - );
285 -
286 - $this->add_group_control(
287 - \Elementor\Group_Control_Border::get_type(),
288 - [
289 - 'name' => 'tab_title_border',
290 - 'selector' => '{{WRAPPER}} .eel-tab-titles li',
291 - 'separator' => 'before',
292 - ]
293 - );
294 -
295 - $this->add_control(
296 - 'tab_title_border_radius',
297 - [
298 - 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
299 - 'type' => \Elementor\Controls_Manager::DIMENSIONS,
300 - 'size_units' => [ 'px', '%' ],
301 - 'selectors' => [
302 - '{{WRAPPER}} .eel-tab-titles li' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
303 - ],
304 - 'separator' => 'before',
305 - ]
306 - );
307 -
308 - $this->add_responsive_control(
309 - 'tab_title_padding',
310 - [
311 - 'label' => esc_html__( 'Padding', 'easy-elements' ),
312 - 'type' => \Elementor\Controls_Manager::DIMENSIONS,
313 - 'size_units' => [ 'px', 'em', '%' ],
314 - 'selectors' => [
315 - '{{WRAPPER}} .eel-tab-titles li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
316 - ],
317 - 'separator' => 'before',
318 - ]
319 - );
320 -
321 - $this->add_responsive_control(
322 - 'tab_title_margin',
323 - [
324 - 'label' => esc_html__( 'Margin', 'easy-elements' ),
325 - 'type' => \Elementor\Controls_Manager::DIMENSIONS,
326 - 'size_units' => [ 'px', 'em', '%' ],
327 - 'selectors' => [
328 - '{{WRAPPER}} .eel-tab-titles li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
329 - ],
330 - 'separator' => 'before',
331 - ]
332 - );
333 -
334 -
335 - $this->add_control(
336 - 'tab_icon_color',
337 - [
338 - 'label' => esc_html__( 'Icon Color', 'easy-elements' ),
339 - 'type' => \Elementor\Controls_Manager::COLOR,
340 - 'selectors' => [
341 - '{{WRAPPER}} .eel-tab-titles i, {{WRAPPER}} .eel-tab-titles svg' => 'color: {{VALUE}}; fill: {{VALUE}}',
342 - ],
343 - 'description' => esc_html__( 'Only works when "Icon" is selected as icon type. 😊', 'easy-elements' ),
344 - 'separator' => 'before',
345 - ]
346 - );
347 -
348 - $this->add_control(
349 - 'tab_icon_bg_color',
350 - [
351 - 'label' => esc_html__( 'Icon/image Bg Color', 'easy-elements' ),
352 - 'type' => \Elementor\Controls_Manager::COLOR,
353 - 'selectors' => [
354 - '{{WRAPPER}} .ee-tab-image, {{WRAPPER}} .ee-tab-icon' => 'background-color: {{VALUE}}',
355 - ],
356 - 'separator' => 'before',
357 - ]
358 - );
359 -
360 - $this->end_controls_tab();
361 -
362 - $this->start_controls_tab(
363 - 'tab_title_active',
364 - [
365 - 'label' => esc_html__( 'Active', 'easy-elements' ),
366 - ]
367 - );
368 -
369 - $this->add_control(
370 - 'tab_title_active_color',
371 - [
372 - 'label' => esc_html__( 'Color', 'easy-elements' ),
373 - 'type' => \Elementor\Controls_Manager::COLOR,
374 - 'default' => '#ffffff',
375 - 'selectors' => [
376 - '{{WRAPPER}} .eel-tab-titles li.active .ee-tab-title-text, {{WRAPPER}} .eel-tab-titles li:hover .ee-tab-title-text' => 'color: {{VALUE}}',
377 - ],
378 - ]
379 - );
380 -
381 - $this->add_control(
382 - 'tab_title_active_bg_color',
383 - [
384 - 'label' => esc_html__( 'Background Color', 'easy-elements' ),
385 - 'type' => \Elementor\Controls_Manager::COLOR,
386 - 'default' => '#5933FF',
387 - 'selectors' => [
388 - '{{WRAPPER}} .eel-tab-titles li.active, {{WRAPPER}} .eel-tab-titles li:hover' => 'background-color: {{VALUE}}',
389 - ],
390 - ]
391 - );
392 -
393 - $this->add_control(
394 - 'tab_title_active_border_color',
395 - [
396 - 'label' => esc_html__( 'Border Color', 'easy-elements' ),
397 - 'type' => \Elementor\Controls_Manager::COLOR,
398 - 'selectors' => [
399 - '{{WRAPPER}} .eel-tab-titles li.active, {{WRAPPER}} .eel-tab-titles li:hover' => 'border-color: {{VALUE}}',
400 - ],
401 - 'default' => '#5933FF',
402 - 'condition' => [
403 - 'tab_title_border_border!' => '',
404 - ],
405 - ]
406 - );
407 -
408 - $this->end_controls_tab();
409 - $this->end_controls_tabs();
410 - $this->end_controls_section();
411 -
412 - $this->start_controls_section(
413 - 'tab_title_style__nav_section',
414 - [
415 - 'label' => esc_html__( 'Tab Nav Part Border & Spacing', 'easy-elements' ),
416 - 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
417 - ]
418 - );
419 -
420 - $this->add_responsive_control(
421 - 'tab_title_space',
422 - [
423 - 'label' => esc_html__( 'Bottom Spacing', 'easy-elements' ),
424 - 'type' => \Elementor\Controls_Manager::SLIDER,
425 - 'range' => [
426 - 'px' => [
427 - 'min' => 6,
428 - 'max' => 100,
429 - ],
430 - ],
431 - 'selectors' => [
432 - '{{WRAPPER}} .ee-tabs-wrapper[data-tab-direction="top"] .eel-tab-titles' => 'padding: 0 0 {{SIZE}}{{UNIT}};',
433 - ],
434 - 'separator' => 'before',
435 - ]
436 - );
437 -
438 - $this->add_group_control(
439 - \Elementor\Group_Control_Border::get_type(),
440 - [
441 - 'name' => 'tab_title_bottom_border',
442 - 'selector' => '{{WRAPPER}} .ee-tabs-wrapper[data-tab-direction="top"] .eel-tab-titles',
443 - ]
444 - );
445 -
446 - $this->end_controls_section();
447 -
448 - // Style Tab - Tab Contents
449 - $this->start_controls_section(
450 - 'tab_content_style_area',
451 - [
452 - 'label' => esc_html__( 'Tab Content Area', 'easy-elements' ),
453 - 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
454 - ]
455 - );
456 -
457 - $this->add_control(
458 - 'content_area_bg_color',
459 - [
460 - 'label' => esc_html__( 'Background Color', 'easy-elements' ),
461 - 'type' => \Elementor\Controls_Manager::COLOR,
462 - 'selectors' => [
463 - '{{WRAPPER}} .ee-tab-content' => 'background-color: {{VALUE}}',
464 - ],
465 - 'separator' => 'before',
466 - ]
467 - );
468 -
469 - $this->add_group_control(
470 - \Elementor\Group_Control_Border::get_type(),
471 - [
472 - 'name' => 'content_area_border',
473 - 'selector' => '{{WRAPPER}} .ee-tab-content',
474 - ]
475 - );
476 -
477 - $this->add_control(
478 - 'content_area_border_radius',
479 - [
480 - 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
481 - 'type' => \Elementor\Controls_Manager::DIMENSIONS,
482 - 'size_units' => [ 'px', '%' ],
483 - 'selectors' => [
484 - '{{WRAPPER}} .ee-tab-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
485 - ],
486 - ]
487 - );
488 -
489 - $this->add_responsive_control(
490 - 'content_area_padding',
491 - [
492 - 'label' => esc_html__( 'Padding', 'easy-elements' ),
493 - 'type' => \Elementor\Controls_Manager::DIMENSIONS,
494 - 'size_units' => [ 'px', 'em', '%' ],
495 - 'selectors' => [
496 - '{{WRAPPER}} .ee-tab-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
497 - ],
498 - ]
499 - );
500 -
501 - $this->add_responsive_control(
502 - 'content_area_margin',
503 - [
504 - 'label' => esc_html__( 'Margin', 'easy-elements' ),
505 - 'type' => \Elementor\Controls_Manager::DIMENSIONS,
506 - 'size_units' => [ 'px', 'em', '%' ],
507 - 'selectors' => [
508 - '{{WRAPPER}} .ee-tab-content, {{WRAPPER}} .ee-tabs-wrapper[data-tab-direction="top"] .ee-tab-contents .ee-tab-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
509 - ],
510 - ]
511 - );
512 -
513 - $this->add_responsive_control(
514 - 'description_alignment',
515 - [
516 - 'label' => esc_html__( 'Alignment', 'easy-elements' ),
517 - 'type' => \Elementor\Controls_Manager::CHOOSE,
518 - 'options' => [
519 - 'left' => [
520 - 'title' => esc_html__( 'Left', 'easy-elements' ),
521 - 'icon' => 'eicon-text-align-left',
522 - ],
523 - 'center' => [
524 - 'title' => esc_html__( 'Center', 'easy-elements' ),
525 - 'icon' => 'eicon-text-align-center',
526 - ],
527 - 'right' => [
528 - 'title' => esc_html__( 'Right', 'easy-elements' ),
529 - 'icon' => 'eicon-text-align-right',
530 - ],
531 - 'justify' => [
532 - 'title' => esc_html__( 'Justify', 'easy-elements' ),
533 - 'icon' => 'eicon-text-align-justify',
534 - ],
535 - ],
536 - 'default' => 'center',
537 - 'selectors' => [
538 - '{{WRAPPER}} .ee-tab-contents, {{WRAPPER}} .ee-content-description' => 'text-align: {{VALUE}};',
539 - ],
540 - ]
541 - );
542 -
543 - $this->end_controls_section();
544 -
545 - $this->start_controls_section(
546 - 'tab_content_part_title',
547 - [
548 - 'label' => esc_html__( 'Tab Content Part Title', 'easy-elements' ),
549 - 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
550 - ]
551 - );
552 -
553 - $this->add_group_control(
554 - \Elementor\Group_Control_Typography::get_type(),
555 - [
556 - 'name' => 'content_title_typography',
557 - 'selector' => '{{WRAPPER}} .ee-content-title, {{WRAPPER}} .ee-tab-contents h1, {{WRAPPER}} .ee-tab-contents h2, {{WRAPPER}} .ee-tab-contents h3, {{WRAPPER}} .ee-tab-contents h4, {{WRAPPER}} .ee-tab-contents h5, {{WRAPPER}} .ee-tab-contents h6',
558 - ]
559 - );
560 -
561 - $this->add_control(
562 - 'content_title_color',
563 - [
564 - 'label' => esc_html__( 'Color', 'easy-elements' ),
565 - 'type' => \Elementor\Controls_Manager::COLOR,
566 - 'selectors' => [
567 - '{{WRAPPER}} .ee-content-title, {{WRAPPER}} .ee-tab-contents h1, {{WRAPPER}} .ee-tab-contents h2, {{WRAPPER}} .ee-tab-contents h3, {{WRAPPER}} .ee-tab-contents h4, {{WRAPPER}} .ee-tab-contents h5, {{WRAPPER}} .ee-tab-contents h6' => 'color: {{VALUE}}',
568 - ],
569 - ]
570 - );
571 -
572 - $this->add_responsive_control(
573 - 'content_title_margin',
574 - [
575 - 'label' => esc_html__( 'Margin', 'easy-elements' ),
576 - 'type' => \Elementor\Controls_Manager::DIMENSIONS,
577 - 'size_units' => [ 'px', 'em', '%' ],
578 - 'selectors' => [
579 - '{{WRAPPER}} .ee-content-title, {{WRAPPER}} .ee-tab-contents h1, {{WRAPPER}} .ee-tab-contents h2, {{WRAPPER}} .ee-tab-contents h3, {{WRAPPER}} .ee-tab-contents h4, {{WRAPPER}} .ee-tab-contents h5, {{WRAPPER}} .ee-tab-contents h6' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
580 - ],
581 - ]
582 - );
583 -
584 - $this->end_controls_section();
585 -
586 - $this->start_controls_section(
587 - 'tab_content_style_section',
588 - [
589 - 'label' => esc_html__( 'Tab Description', 'easy-elements' ),
590 - 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
591 - ]
592 - );
593 -
594 - $this->add_group_control(
595 - \Elementor\Group_Control_Typography::get_type(),
596 - [
597 - 'name' => 'content_description_typography',
598 - 'selector' => '{{WRAPPER}} .ee-content-description, {{WRAPPER}} .ee-content-description p',
599 - ]
600 - );
601 -
602 - $this->add_control(
603 - 'content_description_color',
604 - [
605 - 'label' => esc_html__( 'Color', 'easy-elements' ),
606 - 'type' => \Elementor\Controls_Manager::COLOR,
607 - 'selectors' => [
608 - '{{WRAPPER}} .ee-content-description, {{WRAPPER}} .ee-content-description p' => 'color: {{VALUE}}',
609 - ],
610 - ]
611 - );
612 -
613 - $this->add_responsive_control(
614 - 'content_description_margin',
615 - [
616 - 'label' => esc_html__( 'Margin', 'easy-elements' ),
617 - 'type' => \Elementor\Controls_Manager::DIMENSIONS,
618 - 'size_units' => [ 'px', 'em', '%' ],
619 - 'selectors' => [
620 - '{{WRAPPER}} .ee-content-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
621 - ],
622 - ]
623 - );
624 - $this->end_controls_section();
625 -
626 - $this->start_controls_section(
627 - 'tab_content_style_readmore_section',
628 - [
629 - 'label' => esc_html__( 'Tab Button', 'easy-elements' ),
630 - 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
631 - ]
632 - );
633 -
634 - $this->add_group_control(
635 - \Elementor\Group_Control_Typography::get_type(),
636 - [
637 - 'name' => 'read_more_btn_typography',
638 - 'selector' => '{{WRAPPER}} .ee-read-more',
639 - ]
640 - );
641 -
642 - $this->start_controls_tabs( 'read_more_btn_colors' );
643 -
644 - $this->start_controls_tab(
645 - 'read_more_btn_normal',
646 - [
647 - 'label' => esc_html__( 'Normal', 'easy-elements' ),
648 - ]
649 - );
650 -
651 - $this->add_control(
652 - 'read_more_btn_color',
653 - [
654 - 'label' => esc_html__( 'Text Color', 'easy-elements' ),
655 - 'type' => \Elementor\Controls_Manager::COLOR,
656 - 'selectors' => [
657 - '{{WRAPPER}} .ee-read-more' => 'color: {{VALUE}}',
658 - ],
659 - ]
660 - );
661 -
662 - $this->add_control(
663 - 'read_more_btn_bg_color',
664 - [
665 - 'label' => esc_html__( 'Background Color', 'easy-elements' ),
666 - 'type' => \Elementor\Controls_Manager::COLOR,
667 - 'selectors' => [
668 - '{{WRAPPER}} .ee-read-more' => 'background-color: {{VALUE}}',
669 - ],
670 - ]
671 - );
672 -
673 - $this->end_controls_tab();
674 -
675 - $this->start_controls_tab(
676 - 'read_more_btn_hover',
677 - [
678 - 'label' => esc_html__( 'Hover', 'easy-elements' ),
679 - ]
680 - );
681 -
682 - $this->add_control(
683 - 'read_more_btn_hover_color',
684 - [
685 - 'label' => esc_html__( 'Text Color', 'easy-elements' ),
686 - 'type' => \Elementor\Controls_Manager::COLOR,
687 - 'selectors' => [
688 - '{{WRAPPER}} .ee-read-more:hover' => 'color: {{VALUE}}',
689 - ],
690 - ]
691 - );
692 -
693 - $this->add_control(
694 - 'read_more_btn_hover_bg_color',
695 - [
696 - 'label' => esc_html__( 'Background Color', 'easy-elements' ),
697 - 'type' => \Elementor\Controls_Manager::COLOR,
698 - 'selectors' => [
699 - '{{WRAPPER}} .ee-read-more:hover' => 'background-color: {{VALUE}}',
700 - ],
701 - ]
702 - );
703 -
704 - $this->add_control(
705 - 'read_more_btn_hover_border_color',
706 - [
707 - 'label' => esc_html__( 'Border Color', 'easy-elements' ),
708 - 'type' => \Elementor\Controls_Manager::COLOR,
709 - 'selectors' => [
710 - '{{WRAPPER}} .ee-read-more:hover' => 'border-color: {{VALUE}}',
711 - ],
712 - 'condition' => [
713 - 'read_more_btn_border_border!' => '',
714 - ],
715 - ]
716 - );
717 -
718 - $this->end_controls_tab();
719 -
720 - $this->end_controls_tabs();
721 -
722 - $this->add_group_control(
723 - \Elementor\Group_Control_Border::get_type(),
724 - [
725 - 'name' => 'read_more_btn_border',
726 - 'selector' => '{{WRAPPER}} .ee-read-more',
727 - 'separator' => 'before',
728 - ]
729 - );
730 -
731 - $this->add_control(
732 - 'read_more_btn_border_radius',
733 - [
734 - 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
735 - 'type' => \Elementor\Controls_Manager::DIMENSIONS,
736 - 'size_units' => [ 'px', '%' ],
737 - 'selectors' => [
738 - '{{WRAPPER}} .ee-read-more' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
739 - ],
740 - ]
741 - );
742 -
743 - $this->add_responsive_control(
744 - 'read_more_btn_padding',
745 - [
746 - 'label' => esc_html__( 'Padding', 'easy-elements' ),
747 - 'type' => \Elementor\Controls_Manager::DIMENSIONS,
748 - 'size_units' => [ 'px', 'em', '%' ],
749 - 'selectors' => [
750 - '{{WRAPPER}} .ee-read-more' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
751 - ],
752 - ]
753 - );
754 -
755 - $this->add_responsive_control(
756 - 'read_more_btn_margin',
757 - [
758 - 'label' => esc_html__( 'Margin', 'easy-elements' ),
759 - 'type' => \Elementor\Controls_Manager::DIMENSIONS,
760 - 'size_units' => [ 'px', 'em', '%' ],
761 - 'selectors' => [
762 - '{{WRAPPER}} .ee-read-more' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
763 - ],
764 - ]
765 - );
766 - $this->end_controls_section();
767 - }
768 -
769 - protected function render() {
770 - $settings = $this->get_settings_for_display();
771 - $direction = ! empty( $settings['tab_layout_direction'] ) ? $settings['tab_layout_direction'] : 'left';
772 - $icon_position = isset( $settings['tab_icon_position'] ) ? $settings['tab_icon_position'] : 'top';
773 -
774 - if ( ! empty( $settings['tabs'] ) ) {
775 - echo '<div class="ee-tabs-wrapper" data-tab-direction="' . esc_attr( $settings['tab_layout_direction'] ) . '" data-icon-position="' . esc_attr( $icon_position ) . '">';
776 - echo '<ul class="eel-tab-titles">';
777 - foreach ( $settings['tabs'] as $index => $item ) {
778 - echo '<li data-tab="ee-tab-' . esc_attr( $index ) . '">';
779 - if ( isset( $item['tab_title_icon_image_type'] ) ) {
780 - if ( $item['tab_title_icon_image_type'] === 'icon' && ! empty( $item['tab_icon']['value'] ) ) {
781 - echo '<span class="ee-tab-icon">';
782 - \Elementor\Icons_Manager::render_icon( $item['tab_icon'], [ 'aria-hidden' => 'true' ] );
783 - echo '</span>';
784 - } elseif ( $item['tab_title_icon_image_type'] === 'image' && ! empty( $item['tab_image']['id'] ) ) {
785 - echo wp_get_attachment_image( $item['tab_image']['id'], 'full' );
786 - } elseif ( ! empty( $item['tab_image']['url'] ) ) {
787 - echo wp_kses_post(
788 - get_image_tag(
789 - 0,
790 - '',
791 - '',
792 - '',
793 - $item['tab_image']['url']
794 - )
795 - );
796 - }
797 - }
798 - echo '<span class="ee-tab-title-text">' . esc_html( $item['tab_title'] ) . '</span>';
799 - echo '</li>';
800 - }
801 - echo '</ul>';
802 - echo '<div class="ee-tab-contents">';
803 -
804 - foreach ( $settings['tabs'] as $index => $item ) {
805 - echo '<div class="ee-tab-content" id="ee-tab-' . esc_attr( $index ) . '">';
806 -
807 - if ( ! empty( $item['content_title'] ) ) {
808 - echo '<h4 class="ee-content-title">' . esc_html( $item['content_title'] ) . '</h4>';
809 - }
810 -
811 - if ( ! empty( $item['content_description'] ) ) {
812 - echo '<div class="ee-content-description">' . wp_kses_post( $item['content_description'] ) . '</div>';
813 - }
814 -
815 - if ( ! empty( $item['read_more_text'] ) && ! empty( $item['read_more_link']['url'] ) ) {
816 - $target = ! empty( $item['read_more_link']['is_external'] ) ? '_blank' : '_self';
817 - echo '<a class="ee-read-more" href="' . esc_url( $item['read_more_link']['url'] ) . '" target="' . esc_attr( $target ) . '">' . esc_html( $item['read_more_text'] ) . ' <i class="unicon-chevron-right"> </i> </a>';
818 - }
819 -
820 - echo '</div>';
821 - }
822 -
823 - echo '</div>';
824 - echo '</div>';
825 - }
826 - }
827 -}
1 +<?php
2 +if ( ! defined( 'ABSPATH' ) ) {
3 + exit;
4 +}
5 +class Easyel_Tab_Widget extends \Elementor\Widget_Base {
6 +
7 + public function get_style_depends() {
8 + $handle = 'eel-tab-style';
9 + $css_path = plugin_dir_path( __FILE__ ) . 'css/tab.css';
10 +
11 + if ( ! wp_style_is( $handle, 'registered' ) && file_exists( $css_path ) ) {
12 + wp_register_style( $handle, plugins_url( 'css/tab.css', __FILE__ ), [], defined( 'WP_DEBUG' ) && WP_DEBUG ? filemtime( $css_path ) : '1.0.0' );
13 + }
14 + return [ $handle ];
15 + }
16 +
17 +
18 + public function get_script_depends() {
19 + $handle = 'eel-tab-script';
20 + $js_path = plugin_dir_path( __FILE__ ) . 'js/tab.js';
21 +
22 + if ( ! wp_script_is( $handle, 'registered' ) && file_exists( $js_path ) ) {
23 + wp_enqueue_script( $handle, plugins_url( 'js/tab.js', __FILE__ ), [ 'jquery' ], defined( 'WP_DEBUG' ) && WP_DEBUG ? filemtime( $js_path ) : '1.0.0', true );
24 +
25 + }
26 + return [ $handle ];
27 + }
28 +
29 + public function get_name() {
30 + return 'eel-tab';
31 + }
32 +
33 + public function get_title() {
34 + return esc_html__( 'Tabs', 'easy-elements' );
35 + }
36 +
37 + public function get_icon() {
38 + return 'easyicon easyelIcon-tab';
39 + }
40 +
41 + public function get_categories() {
42 + return [ 'easyelements_category' ];
43 + }
44 +
45 + public function get_keywords() {
46 + return [ 'tab', 'link', 'click', 'text' ];
47 + }
48 +
49 + protected function register_controls() {
50 +
51 + $this->start_controls_section(
52 + 'tabs_section',
53 + [
54 + 'label' => esc_html__( 'Tabs Settings', 'easy-elements' ),
55 + 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
56 + ]
57 + );
58 +
59 + $repeater = new \Elementor\Repeater();
60 +
61 + $repeater->add_control(
62 + 'tab_title',
63 + [
64 + 'label' => esc_html__( 'Tab Title', 'easy-elements' ),
65 + 'type' => \Elementor\Controls_Manager::TEXT,
66 + 'default' => esc_html__( 'Tab Title', 'easy-elements' ),
67 + 'label_block' => true,
68 + ]
69 + );
70 +
71 + $repeater->add_control(
72 + 'tab_title_icon_image_type',
73 + [
74 + 'label' => esc_html__( 'Icon / Image', 'easy-elements' ),
75 + 'type' => \Elementor\Controls_Manager::SELECT,
76 + 'options' => [
77 + 'none' => esc_html__( 'None', 'easy-elements' ),
78 + 'icon' => esc_html__( 'Icon', 'easy-elements' ),
79 + 'image' => esc_html__( 'Image', 'easy-elements' ),
80 + ],
81 + 'default' => 'icon',
82 + ]
83 + );
84 +
85 + $repeater->add_control(
86 + 'tab_icon',
87 + [
88 + 'label' => esc_html__( 'Icon', 'easy-elements' ),
89 + 'type' => \Elementor\Controls_Manager::ICONS,
90 + 'label_block' => true,
91 + 'default' => [
92 + 'value' => 'far fa-heart',
93 + 'library' => 'fa-regular',
94 + ],
95 + 'condition' => [
96 + 'tab_title_icon_image_type' => 'icon',
97 + ],
98 + ]
99 + );
100 +
101 + $repeater->add_control(
102 + 'tab_image',
103 + [
104 + 'label' => esc_html__( 'Image', 'easy-elements' ),
105 + 'type' => \Elementor\Controls_Manager::MEDIA,
106 + 'default' => [
107 + 'url' => \Elementor\Utils::get_placeholder_image_src(),
108 + ],
109 + 'condition' => [
110 + 'tab_title_icon_image_type' => 'image',
111 + ],
112 + ]
113 + );
114 +
115 +
116 + $repeater->add_control(
117 + 'content_title',
118 + [
119 + 'label' => esc_html__( 'Content Title', 'easy-elements' ),
120 + 'type' => \Elementor\Controls_Manager::TEXT,
121 + 'default' => esc_html__( 'Your Title Here', 'easy-elements' ),
122 + 'label_block' => true,
123 + ]
124 + );
125 +
126 + $repeater->add_control(
127 + 'content_description',
128 + [
129 + 'label' => esc_html__( 'Description', 'easy-elements' ),
130 + 'type' => \Elementor\Controls_Manager::WYSIWYG,
131 + 'default' => esc_html__( 'Your description here.', 'easy-elements' ),
132 + ]
133 + );
134 +
135 + $repeater->add_control(
136 + 'read_more_text',
137 + [
138 + 'label' => esc_html__( 'Button Text', 'easy-elements' ),
139 + 'type' => \Elementor\Controls_Manager::TEXT,
140 + 'default' => esc_html__( 'Let\'s find out', 'easy-elements' ),
141 + ]
142 + );
143 +
144 + $repeater->add_control(
145 + 'read_more_link',
146 + [
147 + 'label' => esc_html__( 'Button URL', 'easy-elements' ),
148 + 'type' => \Elementor\Controls_Manager::URL,
149 + 'placeholder' => 'https://your-link.com',
150 + ]
151 + );
152 +
153 + $this->add_control(
154 + 'tabs',
155 + [
156 + 'label' => esc_html__( 'Tabs Items', 'easy-elements' ),
157 + 'type' => \Elementor\Controls_Manager::REPEATER,
158 + 'fields' => $repeater->get_controls(),
159 + 'default' => [
160 + [
161 + 'tab_title' => 'Our Company',
162 + 'content_title' => '',
163 + 'content_description' => 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using Content here, content here, making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for lorem ipsum will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose',
164 + 'read_more_text' => '',
165 + 'read_more_link' => ['url' => '#'],
166 + ],
167 + [
168 + 'tab_title' => 'Our Mission',
169 + 'content_title' => '',
170 + 'content_description' => 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using Content here, content here, making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for lorem ipsum will uncover',
171 + 'read_more_text' => '',
172 + 'read_more_link' => ['url' => '#'],
173 + ],
174 + [
175 + 'tab_title' => 'Our Vision',
176 + 'content_title' => '',
177 + 'content_description' => 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using Content here, content here, making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for lorem ipsum will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters,',
178 + 'read_more_text' => '',
179 + 'read_more_link' => ['url' => '#'],
180 + ],
181 + ],
182 + 'title_field' => '{{{ tab_title }}}',
183 + ]
184 + );
185 +
186 + $this->end_controls_section();
187 +
188 +
189 + $this->start_controls_section(
190 + 'tabs_nav_section',
191 + [
192 + 'label' => esc_html__( 'Tab Title Settings', 'easy-elements' ),
193 + 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
194 + ]
195 + );
196 +
197 + $this->add_control(
198 + 'tab_icon_position',
199 + [
200 + 'label' => esc_html__( 'Icon Position', 'easy-elements' ),
201 + 'type' => \Elementor\Controls_Manager::CHOOSE,
202 + 'default' => 'left',
203 + 'options' => [
204 + 'left' => [
205 + 'title' => esc_html__( 'Left', 'easy-elements' ),
206 + 'icon' => 'eicon-h-align-left',
207 + ],
208 + 'top' => [
209 + 'title' => esc_html__( 'Top', 'easy-elements' ),
210 + 'icon' => 'eicon-v-align-top',
211 + ],
212 + 'right' => [
213 + 'title' => esc_html__( 'Right', 'easy-elements' ),
214 + 'icon' => 'eicon-h-align-right',
215 + ],
216 + ],
217 + 'toggle' => false,
218 + ]
219 + );
220 +
221 + $this->add_control(
222 + 'tab_layout_direction',
223 + [
224 + 'label' => esc_html__( 'Layout', 'easy-elements' ),
225 + 'type' => \Elementor\Controls_Manager::CHOOSE,
226 + 'default' => 'top',
227 + 'options' => [
228 + 'left' => [
229 + 'title' => esc_html__( 'Left', 'easy-elements' ),
230 + 'icon' => 'eicon-h-align-left',
231 + ],
232 + 'top' => [
233 + 'title' => esc_html__( 'Top', 'easy-elements' ),
234 + 'icon' => 'eicon-v-align-top',
235 + ],
236 + 'right' => [
237 + 'title' => esc_html__( 'Right', 'easy-elements' ),
238 + 'icon' => 'eicon-h-align-right',
239 + ],
240 + ],
241 + 'toggle' => false,
242 + ]
243 + );
244 +
245 + $this->end_controls_section();
246 +
247 + // Style Tab - Tab Titles
248 + $this->start_controls_section(
249 + 'tab_title_style_section',
250 + [
251 + 'label' => esc_html__( 'Tab Nav', 'easy-elements' ),
252 + 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
253 + ]
254 + );
255 +
256 + $this->add_group_control(
257 + \Elementor\Group_Control_Typography::get_type(),
258 + [
259 + 'name' => 'tab_title_typography',
260 + 'selector' => '{{WRAPPER}} .ee-tab-title-text',
261 + ]
262 + );
263 +
264 + $this->start_controls_tabs( 'tab_title_colors' );
265 +
266 + $this->start_controls_tab(
267 + 'tab_title_normal',
268 + [
269 + 'label' => esc_html__( 'Normal', 'easy-elements' ),
270 + ]
271 + );
272 +
273 + $this->add_control(
274 + 'tab_title_color',
275 + [
276 + 'label' => esc_html__( 'Text Color', 'easy-elements' ),
277 + 'type' => \Elementor\Controls_Manager::COLOR,
278 + 'selectors' => [
279 + '{{WRAPPER}} .ee-tab-title-text' => 'color: {{VALUE}}',
280 + ],
281 + ]
282 + );
283 +
284 + $this->add_control(
285 + 'tab_title_bg_color',
286 + [
287 + 'label' => esc_html__( 'Background Color', 'easy-elements' ),
288 + 'type' => \Elementor\Controls_Manager::COLOR,
289 + 'selectors' => [
290 + '{{WRAPPER}} .eel-tab-titles li' => 'background-color: {{VALUE}}',
291 + ],
292 + 'separator' => 'before',
293 + ]
294 + );
295 +
296 + $this->add_group_control(
297 + \Elementor\Group_Control_Border::get_type(),
298 + [
299 + 'name' => 'tab_title_border',
300 + 'selector' => '{{WRAPPER}} .eel-tab-titles li',
301 + 'separator' => 'before',
302 + ]
303 + );
304 +
305 + $this->add_control(
306 + 'tab_title_border_radius',
307 + [
308 + 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
309 + 'type' => \Elementor\Controls_Manager::DIMENSIONS,
310 + 'size_units' => [ 'px', '%' ],
311 + 'selectors' => [
312 + '{{WRAPPER}} .eel-tab-titles li' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
313 + ],
314 + 'separator' => 'before',
315 + ]
316 + );
317 +
318 + $this->add_responsive_control(
319 + 'tab_title_padding',
320 + [
321 + 'label' => esc_html__( 'Padding', 'easy-elements' ),
322 + 'type' => \Elementor\Controls_Manager::DIMENSIONS,
323 + 'size_units' => [ 'px', 'em', '%' ],
324 + 'selectors' => [
325 + '{{WRAPPER}} .eel-tab-titles li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
326 + ],
327 + 'separator' => 'before',
328 + ]
329 + );
330 +
331 + $this->add_responsive_control(
332 + 'tab_title_margin',
333 + [
334 + 'label' => esc_html__( 'Margin', 'easy-elements' ),
335 + 'type' => \Elementor\Controls_Manager::DIMENSIONS,
336 + 'size_units' => [ 'px', 'em', '%' ],
337 + 'selectors' => [
338 + '{{WRAPPER}} .eel-tab-titles li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
339 + ],
340 + 'separator' => 'before',
341 + ]
342 + );
343 +
344 +
345 + $this->add_control(
346 + 'tab_icon_color',
347 + [
348 + 'label' => esc_html__( 'Icon Color', 'easy-elements' ),
349 + 'type' => \Elementor\Controls_Manager::COLOR,
350 + 'selectors' => [
351 + '{{WRAPPER}} .eel-tab-titles i, {{WRAPPER}} .eel-tab-titles svg' => 'color: {{VALUE}}; fill: {{VALUE}}',
352 + ],
353 + 'description' => esc_html__( 'Only works when "Icon" is selected as icon type. 😊', 'easy-elements' ),
354 + 'separator' => 'before',
355 + ]
356 + );
357 +
358 + $this->add_control(
359 + 'tab_icon_bg_color',
360 + [
361 + 'label' => esc_html__( 'Icon/image Bg Color', 'easy-elements' ),
362 + 'type' => \Elementor\Controls_Manager::COLOR,
363 + 'selectors' => [
364 + '{{WRAPPER}} .ee-tab-image, {{WRAPPER}} .ee-tab-icon' => 'background-color: {{VALUE}}',
365 + ],
366 + 'separator' => 'before',
367 + ]
368 + );
369 +
370 + $this->end_controls_tab();
371 +
372 + $this->start_controls_tab(
373 + 'tab_title_active',
374 + [
375 + 'label' => esc_html__( 'Active', 'easy-elements' ),
376 + ]
377 + );
378 +
379 + $this->add_control(
380 + 'tab_title_active_color',
381 + [
382 + 'label' => esc_html__( 'Color', 'easy-elements' ),
383 + 'type' => \Elementor\Controls_Manager::COLOR,
384 + 'default' => '#ffffff',
385 + 'selectors' => [
386 + '{{WRAPPER}} .eel-tab-titles li.active .ee-tab-title-text, {{WRAPPER}} .eel-tab-titles li:hover .ee-tab-title-text' => 'color: {{VALUE}}',
387 + ],
388 + ]
389 + );
390 +
391 + $this->add_control(
392 + 'tab_title_active_bg_color',
393 + [
394 + 'label' => esc_html__( 'Background Color', 'easy-elements' ),
395 + 'type' => \Elementor\Controls_Manager::COLOR,
396 + 'default' => '#5933FF',
397 + 'selectors' => [
398 + '{{WRAPPER}} .eel-tab-titles li.active, {{WRAPPER}} .eel-tab-titles li:hover' => 'background-color: {{VALUE}}',
399 + ],
400 + ]
401 + );
402 +
403 + $this->add_control(
404 + 'tab_title_active_border_color',
405 + [
406 + 'label' => esc_html__( 'Border Color', 'easy-elements' ),
407 + 'type' => \Elementor\Controls_Manager::COLOR,
408 + 'selectors' => [
409 + '{{WRAPPER}} .eel-tab-titles li.active, {{WRAPPER}} .eel-tab-titles li:hover' => 'border-color: {{VALUE}}',
410 + ],
411 + 'default' => '#5933FF',
412 + 'condition' => [
413 + 'tab_title_border_border!' => '',
414 + ],
415 + ]
416 + );
417 +
418 + $this->end_controls_tab();
419 + $this->end_controls_tabs();
420 + $this->end_controls_section();
421 +
422 + $this->start_controls_section(
423 + 'tab_title_style__nav_section',
424 + [
425 + 'label' => esc_html__( 'Tab Nav Part Border & Spacing', 'easy-elements' ),
426 + 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
427 + ]
428 + );
429 +
430 + $this->add_responsive_control(
431 + 'tab_title_space',
432 + [
433 + 'label' => esc_html__( 'Bottom Spacing', 'easy-elements' ),
434 + 'type' => \Elementor\Controls_Manager::SLIDER,
435 + 'range' => [
436 + 'px' => [
437 + 'min' => 6,
438 + 'max' => 100,
439 + ],
440 + ],
441 + 'selectors' => [
442 + '{{WRAPPER}} .ee-tabs-wrapper[data-tab-direction="top"] .eel-tab-titles' => 'padding: 0 0 {{SIZE}}{{UNIT}};',
443 + ],
444 + 'separator' => 'before',
445 + ]
446 + );
447 +
448 + $this->add_group_control(
449 + \Elementor\Group_Control_Border::get_type(),
450 + [
451 + 'name' => 'tab_title_bottom_border',
452 + 'selector' => '{{WRAPPER}} .ee-tabs-wrapper[data-tab-direction="top"] .eel-tab-titles',
453 + ]
454 + );
455 +
456 + $this->end_controls_section();
457 +
458 + // Style Tab - Tab Contents
459 + $this->start_controls_section(
460 + 'tab_content_style_area',
461 + [
462 + 'label' => esc_html__( 'Tab Content Area', 'easy-elements' ),
463 + 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
464 + ]
465 + );
466 +
467 + $this->add_control(
468 + 'content_area_bg_color',
469 + [
470 + 'label' => esc_html__( 'Background Color', 'easy-elements' ),
471 + 'type' => \Elementor\Controls_Manager::COLOR,
472 + 'selectors' => [
473 + '{{WRAPPER}} .ee-tab-content' => 'background-color: {{VALUE}}',
474 + ],
475 + 'separator' => 'before',
476 + ]
477 + );
478 +
479 + $this->add_group_control(
480 + \Elementor\Group_Control_Border::get_type(),
481 + [
482 + 'name' => 'content_area_border',
483 + 'selector' => '{{WRAPPER}} .ee-tab-content',
484 + ]
485 + );
486 +
487 + $this->add_control(
488 + 'content_area_border_radius',
489 + [
490 + 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
491 + 'type' => \Elementor\Controls_Manager::DIMENSIONS,
492 + 'size_units' => [ 'px', '%' ],
493 + 'selectors' => [
494 + '{{WRAPPER}} .ee-tab-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
495 + ],
496 + ]
497 + );
498 +
499 + $this->add_responsive_control(
500 + 'content_area_padding',
501 + [
502 + 'label' => esc_html__( 'Padding', 'easy-elements' ),
503 + 'type' => \Elementor\Controls_Manager::DIMENSIONS,
504 + 'size_units' => [ 'px', 'em', '%' ],
505 + 'selectors' => [
506 + '{{WRAPPER}} .ee-tab-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
507 + ],
508 + ]
509 + );
510 +
511 + $this->add_responsive_control(
512 + 'content_area_margin',
513 + [
514 + 'label' => esc_html__( 'Margin', 'easy-elements' ),
515 + 'type' => \Elementor\Controls_Manager::DIMENSIONS,
516 + 'size_units' => [ 'px', 'em', '%' ],
517 + 'selectors' => [
518 + '{{WRAPPER}} .ee-tab-content, {{WRAPPER}} .ee-tabs-wrapper[data-tab-direction="top"] .ee-tab-contents .ee-tab-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
519 + ],
520 + ]
521 + );
522 +
523 + $this->add_responsive_control(
524 + 'description_alignment',
525 + [
526 + 'label' => esc_html__( 'Alignment', 'easy-elements' ),
527 + 'type' => \Elementor\Controls_Manager::CHOOSE,
528 + 'options' => [
529 + 'left' => [
530 + 'title' => esc_html__( 'Left', 'easy-elements' ),
531 + 'icon' => 'eicon-text-align-left',
532 + ],
533 + 'center' => [
534 + 'title' => esc_html__( 'Center', 'easy-elements' ),
535 + 'icon' => 'eicon-text-align-center',
536 + ],
537 + 'right' => [
538 + 'title' => esc_html__( 'Right', 'easy-elements' ),
539 + 'icon' => 'eicon-text-align-right',
540 + ],
541 + 'justify' => [
542 + 'title' => esc_html__( 'Justify', 'easy-elements' ),
543 + 'icon' => 'eicon-text-align-justify',
544 + ],
545 + ],
546 + 'default' => 'center',
547 + 'selectors' => [
548 + '{{WRAPPER}} .ee-tab-contents, {{WRAPPER}} .ee-content-description' => 'text-align: {{VALUE}};',
549 + ],
550 + ]
551 + );
552 +
553 + $this->end_controls_section();
554 +
555 + $this->start_controls_section(
556 + 'tab_content_part_title',
557 + [
558 + 'label' => esc_html__( 'Tab Content Part Title', 'easy-elements' ),
559 + 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
560 + ]
561 + );
562 +
563 + $this->add_group_control(
564 + \Elementor\Group_Control_Typography::get_type(),
565 + [
566 + 'name' => 'content_title_typography',
567 + 'selector' => '{{WRAPPER}} .ee-content-title, {{WRAPPER}} .ee-tab-contents h1, {{WRAPPER}} .ee-tab-contents h2, {{WRAPPER}} .ee-tab-contents h3, {{WRAPPER}} .ee-tab-contents h4, {{WRAPPER}} .ee-tab-contents h5, {{WRAPPER}} .ee-tab-contents h6',
568 + ]
569 + );
570 +
571 + $this->add_control(
572 + 'content_title_color',
573 + [
574 + 'label' => esc_html__( 'Color', 'easy-elements' ),
575 + 'type' => \Elementor\Controls_Manager::COLOR,
576 + 'selectors' => [
577 + '{{WRAPPER}} .ee-content-title, {{WRAPPER}} .ee-tab-contents h1, {{WRAPPER}} .ee-tab-contents h2, {{WRAPPER}} .ee-tab-contents h3, {{WRAPPER}} .ee-tab-contents h4, {{WRAPPER}} .ee-tab-contents h5, {{WRAPPER}} .ee-tab-contents h6' => 'color: {{VALUE}}',
578 + ],
579 + ]
580 + );
581 +
582 + $this->add_responsive_control(
583 + 'content_title_margin',
584 + [
585 + 'label' => esc_html__( 'Margin', 'easy-elements' ),
586 + 'type' => \Elementor\Controls_Manager::DIMENSIONS,
587 + 'size_units' => [ 'px', 'em', '%' ],
588 + 'selectors' => [
589 + '{{WRAPPER}} .ee-content-title, {{WRAPPER}} .ee-tab-contents h1, {{WRAPPER}} .ee-tab-contents h2, {{WRAPPER}} .ee-tab-contents h3, {{WRAPPER}} .ee-tab-contents h4, {{WRAPPER}} .ee-tab-contents h5, {{WRAPPER}} .ee-tab-contents h6' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
590 + ],
591 + ]
592 + );
593 +
594 + $this->end_controls_section();
595 +
596 + $this->start_controls_section(
597 + 'tab_content_style_section',
598 + [
599 + 'label' => esc_html__( 'Tab Description', 'easy-elements' ),
600 + 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
601 + ]
602 + );
603 +
604 + $this->add_group_control(
605 + \Elementor\Group_Control_Typography::get_type(),
606 + [
607 + 'name' => 'content_description_typography',
608 + 'selector' => '{{WRAPPER}} .ee-content-description, {{WRAPPER}} .ee-content-description p',
609 + ]
610 + );
611 +
612 + $this->add_control(
613 + 'content_description_color',
614 + [
615 + 'label' => esc_html__( 'Color', 'easy-elements' ),
616 + 'type' => \Elementor\Controls_Manager::COLOR,
617 + 'selectors' => [
618 + '{{WRAPPER}} .ee-content-description, {{WRAPPER}} .ee-content-description p' => 'color: {{VALUE}}',
619 + ],
620 + ]
621 + );
622 +
623 + $this->add_responsive_control(
624 + 'content_description_margin',
625 + [
626 + 'label' => esc_html__( 'Margin', 'easy-elements' ),
627 + 'type' => \Elementor\Controls_Manager::DIMENSIONS,
628 + 'size_units' => [ 'px', 'em', '%' ],
629 + 'selectors' => [
630 + '{{WRAPPER}} .ee-content-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
631 + ],
632 + ]
633 + );
634 + $this->end_controls_section();
635 +
636 + $this->start_controls_section(
637 + 'tab_content_style_readmore_section',
638 + [
639 + 'label' => esc_html__( 'Tab Button', 'easy-elements' ),
640 + 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
641 + ]
642 + );
643 +
644 + $this->add_group_control(
645 + \Elementor\Group_Control_Typography::get_type(),
646 + [
647 + 'name' => 'read_more_btn_typography',
648 + 'selector' => '{{WRAPPER}} .ee-read-more',
649 + ]
650 + );
651 +
652 + $this->start_controls_tabs( 'read_more_btn_colors' );
653 +
654 + $this->start_controls_tab(
655 + 'read_more_btn_normal',
656 + [
657 + 'label' => esc_html__( 'Normal', 'easy-elements' ),
658 + ]
659 + );
660 +
661 + $this->add_control(
662 + 'read_more_btn_color',
663 + [
664 + 'label' => esc_html__( 'Text Color', 'easy-elements' ),
665 + 'type' => \Elementor\Controls_Manager::COLOR,
666 + 'selectors' => [
667 + '{{WRAPPER}} .ee-read-more' => 'color: {{VALUE}}',
668 + ],
669 + ]
670 + );
671 +
672 + $this->add_control(
673 + 'read_more_btn_bg_color',
674 + [
675 + 'label' => esc_html__( 'Background Color', 'easy-elements' ),
676 + 'type' => \Elementor\Controls_Manager::COLOR,
677 + 'selectors' => [
678 + '{{WRAPPER}} .ee-read-more' => 'background-color: {{VALUE}}',
679 + ],
680 + ]
681 + );
682 +
683 + $this->end_controls_tab();
684 +
685 + $this->start_controls_tab(
686 + 'read_more_btn_hover',
687 + [
688 + 'label' => esc_html__( 'Hover', 'easy-elements' ),
689 + ]
690 + );
691 +
692 + $this->add_control(
693 + 'read_more_btn_hover_color',
694 + [
695 + 'label' => esc_html__( 'Text Color', 'easy-elements' ),
696 + 'type' => \Elementor\Controls_Manager::COLOR,
697 + 'selectors' => [
698 + '{{WRAPPER}} .ee-read-more:hover' => 'color: {{VALUE}}',
699 + ],
700 + ]
701 + );
702 +
703 + $this->add_control(
704 + 'read_more_btn_hover_bg_color',
705 + [
706 + 'label' => esc_html__( 'Background Color', 'easy-elements' ),
707 + 'type' => \Elementor\Controls_Manager::COLOR,
708 + 'selectors' => [
709 + '{{WRAPPER}} .ee-read-more:hover' => 'background-color: {{VALUE}}',
710 + ],
711 + ]
712 + );
713 +
714 + $this->add_control(
715 + 'read_more_btn_hover_border_color',
716 + [
717 + 'label' => esc_html__( 'Border Color', 'easy-elements' ),
718 + 'type' => \Elementor\Controls_Manager::COLOR,
719 + 'selectors' => [
720 + '{{WRAPPER}} .ee-read-more:hover' => 'border-color: {{VALUE}}',
721 + ],
722 + 'condition' => [
723 + 'read_more_btn_border_border!' => '',
724 + ],
725 + ]
726 + );
727 +
728 + $this->end_controls_tab();
729 +
730 + $this->end_controls_tabs();
731 +
732 + $this->add_group_control(
733 + \Elementor\Group_Control_Border::get_type(),
734 + [
735 + 'name' => 'read_more_btn_border',
736 + 'selector' => '{{WRAPPER}} .ee-read-more',
737 + 'separator' => 'before',
738 + ]
739 + );
740 +
741 + $this->add_control(
742 + 'read_more_btn_border_radius',
743 + [
744 + 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
745 + 'type' => \Elementor\Controls_Manager::DIMENSIONS,
746 + 'size_units' => [ 'px', '%' ],
747 + 'selectors' => [
748 + '{{WRAPPER}} .ee-read-more' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
749 + ],
750 + ]
751 + );
752 +
753 + $this->add_responsive_control(
754 + 'read_more_btn_padding',
755 + [
756 + 'label' => esc_html__( 'Padding', 'easy-elements' ),
757 + 'type' => \Elementor\Controls_Manager::DIMENSIONS,
758 + 'size_units' => [ 'px', 'em', '%' ],
759 + 'selectors' => [
760 + '{{WRAPPER}} .ee-read-more' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
761 + ],
762 + ]
763 + );
764 +
765 + $this->add_responsive_control(
766 + 'read_more_btn_margin',
767 + [
768 + 'label' => esc_html__( 'Margin', 'easy-elements' ),
769 + 'type' => \Elementor\Controls_Manager::DIMENSIONS,
770 + 'size_units' => [ 'px', 'em', '%' ],
771 + 'selectors' => [
772 + '{{WRAPPER}} .ee-read-more' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
773 + ],
774 + ]
775 + );
776 + $this->end_controls_section();
777 + }
778 +
779 + protected function render() {
780 + $settings = $this->get_settings_for_display();
781 + $direction = ! empty( $settings['tab_layout_direction'] ) ? $settings['tab_layout_direction'] : 'left';
782 + $icon_position = isset( $settings['tab_icon_position'] ) ? $settings['tab_icon_position'] : 'top';
783 +
784 + if ( ! empty( $settings['tabs'] ) ) {
785 + echo '<div class="ee-tabs-wrapper" data-tab-direction="' . esc_attr( $settings['tab_layout_direction'] ) . '" data-icon-position="' . esc_attr( $icon_position ) . '">';
786 + echo '<ul class="eel-tab-titles">';
787 + foreach ( $settings['tabs'] as $index => $item ) {
788 + echo '<li data-tab="ee-tab-' . esc_attr( $index ) . '">';
789 + if ( isset( $item['tab_title_icon_image_type'] ) ) {
790 + if ( $item['tab_title_icon_image_type'] === 'icon' && ! empty( $item['tab_icon']['value'] ) ) {
791 + echo '<span class="ee-tab-icon">';
792 + \Elementor\Icons_Manager::render_icon( $item['tab_icon'], [ 'aria-hidden' => 'true' ] );
793 + echo '</span>';
794 + } elseif ( $item['tab_title_icon_image_type'] === 'image' && ! empty( $item['tab_image']['id'] ) ) {
795 + echo wp_get_attachment_image( $item['tab_image']['id'], 'full' );
796 + } elseif ( ! empty( $item['tab_image']['url'] ) ) {
797 + echo wp_kses_post(
798 + get_image_tag(
799 + 0,
800 + '',
801 + '',
802 + '',
803 + $item['tab_image']['url']
804 + )
805 + );
806 + }
807 + }
808 + echo '<span class="ee-tab-title-text">' . esc_html( $item['tab_title'] ) . '</span>';
809 + echo '</li>';
810 + }
811 + echo '</ul>';
812 + echo '<div class="ee-tab-contents">';
813 +
814 + foreach ( $settings['tabs'] as $index => $item ) {
815 + echo '<div class="ee-tab-content" id="ee-tab-' . esc_attr( $index ) . '">';
816 +
817 + if ( ! empty( $item['content_title'] ) ) {
818 + echo '<h4 class="ee-content-title">' . esc_html( $item['content_title'] ) . '</h4>';
819 + }
820 +
821 + if ( ! empty( $item['content_description'] ) ) {
822 + echo '<div class="ee-content-description">' . wp_kses_post( $item['content_description'] ) . '</div>';
823 + }
824 +
825 + if ( ! empty( $item['read_more_text'] ) && ! empty( $item['read_more_link']['url'] ) ) {
826 + $target = ! empty( $item['read_more_link']['is_external'] ) ? '_blank' : '_self';
827 + echo '<a class="ee-read-more" href="' . esc_url( $item['read_more_link']['url'] ) . '" target="' . esc_attr( $target ) . '">' . esc_html( $item['read_more_text'] ) . ' <i class="unicon-chevron-right"> </i> </a>';
828 + }
829 +
830 + echo '</div>';
831 + }
832 +
833 + echo '</div>';
834 + echo '</div>';
835 + }
836 + }
837 +}
838 +?>