PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.5.0
Easy Elements for Elementor – Addons & Website Templates v1.5.0
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
easy-elements / widgets / process-grid / process-grid.php

process-grid.php in Easy Elements for Elementor – Addons & Website Templates 1.5.0, at widgets/process-grid/process-grid.php

613 lines 23.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Easyel\EasyElements\Widgets;
3 use Elementor\Repeater;
4 use Elementor\Utils;
5 use Elementor\Controls_Manager;
6 use Elementor\Responsive_Control;
7 use Elementor\Group_Control_Image_Size;
8 use Elementor\Group_Control_Box_Shadow;
9 use Elementor\Group_Control_Typography;
10 defined( 'ABSPATH' ) || die();
11
12 class Easyel_Process_Grid_Widget extends \Elementor\Widget_Base {
13
14 public function get_name() {
15 return 'eel-process';
16 }
17
18 public function get_title() {
19 return esc_html__( 'Process Grid', 'easy-elements' );
20 }
21
22 public function get_icon() {
23 return 'easyicon easyelIcon-process-grid';
24 }
25
26 public function get_categories() {
27 return [ 'easyelements_category' ];
28 }
29
30 public function get_keywords() {
31 return [ 'process', 'sevice', 'icon', 'process-box', 'text' ];
32 }
33
34 public function get_style_depends() {
35 return [
36 'eel-process',
37 ];
38 }
39
40
41 protected function register_controls() {
42 $this->start_controls_section(
43 '_section_logo',
44 [
45 'label' => esc_html__( 'Process Grid Settings', 'easy-elements' ),
46 'tab' => Controls_Manager::TAB_CONTENT,
47 ]
48 );
49
50 $repeater = new Repeater();
51
52 $repeater->add_control(
53 'icon',
54 [
55 'label' => esc_html__( 'Icon', 'easy-elements' ),
56 'type' => \Elementor\Controls_Manager::ICONS,
57 'label_block' => true,
58 'default' => [
59 'value' => 'fas fa-star',
60 'library' => 'fa-solid',
61 ],
62 ]
63 );
64
65 $repeater->add_control(
66 '_title',
67 [
68 'label' => esc_html__( 'Title', 'easy-elements' ),
69 'type' => \Elementor\Controls_Manager::TEXT,
70 'default' => esc_html__( 'Manufacturing Industrial', 'easy-elements' ),
71 'label_block' => true,
72 ]
73 );
74
75 $repeater->add_control(
76 '_description',
77 [
78 'label' => esc_html__( 'Description', 'easy-elements' ),
79 'type' => \Elementor\Controls_Manager::TEXTAREA,
80 'default' => esc_html__( 'Optimizing production and supply chain operations and generational transitions', 'easy-elements' ),
81 ]
82 );
83
84 $repeater->add_control(
85 'link',
86 [
87 'label' => esc_html__('Link', 'easy-elements'),
88 'type' => Controls_Manager::URL,
89 'placeholder' => 'https://example.com',
90 ]
91 );
92 $repeater->add_control(
93 'process_number_or_icon',
94 [
95 'label' => esc_html__('Process Number or Icon', 'easy-elements'),
96 'type' => \Elementor\Controls_Manager::SELECT,
97 'options' => [
98 'p_number' => esc_html__('Process Number', 'easy-elements'),
99 'p_icon' => esc_html__('Process Icon', 'easy-elements'),
100 ],
101 'default' => 'p_number',
102 ]
103 );
104 $repeater->add_control(
105 'process_number',
106 [
107 'label' => esc_html__( 'Process Number', 'easy-elements' ),
108 'type' => \Elementor\Controls_Manager::TEXT,
109 'default' => '1',
110 'placeholder' => 'Enter a number',
111 'condition' => [
112 'process_number_or_icon' => 'p_number',
113 ],
114 ]
115 );
116 $repeater->add_control(
117 'process_icon',
118 [
119 'label' => esc_html__( 'Process Icon', 'easy-elements' ),
120 'type' => \Elementor\Controls_Manager::ICONS,
121 'label_block' => true,
122 'default' => [
123 'value' => 'fas fa-long-arrow-alt-right',
124 'library' => 'fa-solid',
125 ],
126 'condition' => [
127 'process_number_or_icon' => 'p_icon',
128 ],
129 ]
130 );
131
132
133 $this->add_control(
134 'easy_icon_box',
135 [
136 'type' => Controls_Manager::REPEATER,
137 'fields' => $repeater->get_controls(),
138 'title_field' => '{{{ _title }}}',
139 'default' => [
140 [
141 'icon' => [
142 'value' => 'fas fa-heart',
143 'library' => 'fa-solid',
144 ],
145 '_title' => esc_html__( 'Manufacturing Industrial', 'easy-elements' ),
146 '_description' => esc_html__( 'Optimizing production and supply chain operations and generational transitions', 'easy-elements' ),
147 'link' => ['url' => ''],
148 ],
149 [
150 'icon' => [
151 'value' => 'fas fa-heart',
152 'library' => 'fa-solid',
153 ],
154 '_title' => esc_html__( 'Professional Services', 'easy-elements' ),
155 '_description' => esc_html__( 'Growth strategies for knowledge-based businesses with strategic guidance throughout', 'easy-elements' ),
156 'link' => ['url' => ''],
157 ],
158 [
159 'icon' => [
160 'value' => 'fas fa-heart',
161 'library' => 'fa-solid',
162 ],
163 '_title' => esc_html__( 'Technology & SaaS', 'easy-elements' ),
164 '_description' => esc_html__( 'Scaling strategies for rapid growth and market leadership expertise for companies facing challenges', 'easy-elements' ),
165 'link' => ['url' => ''],
166 ],
167 ],
168 ]
169 );
170
171 $this->add_control(
172 'icon_direction',
173 [
174 'label' => esc_html__( 'Direction', 'easy-elements' ),
175 'type' => \Elementor\Controls_Manager::CHOOSE,
176 'default' => 'top',
177 'options' => [
178 'left' => [
179 'title' => esc_html__( 'Left', 'easy-elements' ),
180 'icon' => 'eicon-h-align-left',
181 ],
182 'top' => [
183 'title' => esc_html__( 'Top', 'easy-elements' ),
184 'icon' => 'eicon-v-align-top',
185 ],
186 'right' => [
187 'title' => esc_html__( 'Right', 'easy-elements' ),
188 'icon' => 'eicon-h-align-right',
189 ],
190 ],
191 'toggle' => false,
192 ]
193 );
194
195 $this->add_responsive_control(
196 '_text_align',
197 [
198 'label' => esc_html__( 'Alignment', 'easy-elements' ),
199 'type' => \Elementor\Controls_Manager::CHOOSE,
200 'options' => [
201 'left' => [
202 'title' => esc_html__( 'Left', 'easy-elements' ),
203 'icon' => 'eicon-text-align-left',
204 ],
205 'center' => [
206 'title' => esc_html__( 'Center', 'easy-elements' ),
207 'icon' => 'eicon-text-align-center',
208 ],
209 'right' => [
210 'title' => esc_html__( 'Right', 'easy-elements' ),
211 'icon' => 'eicon-text-align-right',
212 ],
213 ],
214 'default' => 'center',
215 'selectors' => [
216 '{{WRAPPER}} .ee--icon-box' => 'text-align: {{VALUE}};',
217 ],
218 ]
219 );
220
221 $this->add_control(
222 'title_tag',
223 [
224 'label' => esc_html__( 'Title HTML Tag', 'easy-elements' ),
225 'type' => \Elementor\Controls_Manager::SELECT,
226 'default' => 'h3',
227 'options' => [
228 'h1' => 'H1',
229 'h2' => 'H2',
230 'h3' => 'H3',
231 'h4' => 'H4',
232 'h5' => 'H5',
233 'h6' => 'H6',
234 'div' => 'div',
235 'span' => 'span',
236 'p' => 'p',
237 ],
238 ]
239 );
240
241 $this->add_responsive_control(
242 'columns',
243 [
244 'label' => esc_html__( 'Select Columns', 'easy-elements' ),
245 'type' => Controls_Manager::SELECT,
246 'default' => '3',
247 'tablet_default' => '3',
248 'mobile_default' => '2',
249 'options' => [
250 '1' => '1 Column',
251 '2' => '2 Columns',
252 '3' => '3 Columns',
253 '4' => '4 Columns',
254 '5' => '5 Columns',
255 '6' => '6 Columns',
256 ],
257 'selectors' => [
258 '{{WRAPPER}} .eel-icon-box-wrap .eel-icon-item' => 'width: calc(100% / {{VALUE}});',
259 ],
260 ]
261 );
262
263
264 $this->add_responsive_control(
265 'item_padding',
266 [
267 'label' => esc_html__( 'Space', 'easy-elements' ),
268 'type' => Controls_Manager::DIMENSIONS,
269 'size_units' => [ 'px', 'em', '%' ],
270 'selectors' => [
271 '{{WRAPPER}} .eel-icon-box-wrap .eel-icon-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
272 ],
273 ]
274 );
275
276 $this->end_controls_section();
277
278 $this->start_controls_section(
279 'section_style_icon_box',
280 [
281 'label' => esc_html__( 'Box Style', 'easy-elements' ),
282 'tab' => Controls_Manager::TAB_STYLE,
283 ]
284 );
285
286 $this->add_control(
287 'box_background_color',
288 [
289 'label' => esc_html__( 'Background Color', 'easy-elements' ),
290 'type' => Controls_Manager::COLOR,
291 'selectors' => [
292 '{{WRAPPER}} .eel-icon-item .ee--icon-box' => 'background-color: {{VALUE}};',
293 ],
294 ]
295 );
296
297 $this->add_responsive_control(
298 'item_padding_inner',
299 [
300 'label' => esc_html__( 'Padding', 'easy-elements' ),
301 'type' => Controls_Manager::DIMENSIONS,
302 'size_units' => [ 'px', 'em', '%' ],
303 'selectors' => [
304 '{{WRAPPER}} .eel-icon-box-wrap .eel-icon-item .ee--icon-box' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
305 ],
306 ]
307 );
308
309 $this->add_group_control(
310 \Elementor\Group_Control_Border::get_type(),
311 [
312 'name' => 'item_border',
313 'selector' => '{{WRAPPER}} .ee--icon-box',
314 ]
315 );
316
317 $this->add_control(
318 'item__border_radius',
319 [
320 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
321 'type' => \Elementor\Controls_Manager::DIMENSIONS,
322 'size_units' => [ 'px', '%' ],
323 'selectors' => [
324 '{{WRAPPER}} .eel-icon-box-wrap .eel-icon-item .ee--icon-box' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
325 ],
326 ]
327 );
328 $this->add_group_control(
329 \Elementor\Group_Control_Box_Shadow::get_type(),
330 [
331 'name' => 'item_box_shadow',
332 'selector' => '{{WRAPPER}} .eel-icon-box-wrap .ee--icon-box',
333 ]
334 );
335
336 $this->end_controls_section();
337
338 $this->start_controls_section(
339 'section_style_icon',
340 [
341 'label' => esc_html__( 'Icon', 'easy-elements' ),
342 'tab' => Controls_Manager::TAB_STYLE,
343 ]
344 );
345
346 $this->add_control(
347 'icon_color',
348 [
349 'label' => esc_html__( 'Color', 'easy-elements' ),
350 'type' => Controls_Manager::COLOR,
351 'selectors' => [
352 '{{WRAPPER}} .ee--icon-box .eel-icon' => 'color: {{VALUE}};',
353 '{{WRAPPER}} .ee--icon-box .eel-icon svg' => 'fill: {{VALUE}};',
354 '{{WRAPPER}} .ee--icon-box .eel-icon svg path' => 'fill: {{VALUE}};',
355 ],
356 ]
357 );
358
359 $this->add_control(
360 'icon_bg_color',
361 [
362 'label' => esc_html__( 'Background', 'easy-elements' ),
363 'type' => Controls_Manager::COLOR,
364 'selectors' => [
365 '{{WRAPPER}} .ee--icon-box .eel-icon' => 'background-color: {{VALUE}};',
366 ],
367 ]
368 );
369
370 $this->add_group_control(
371 \Elementor\Group_Control_Typography::get_type(),
372 [
373 'name' => 'icon_typography',
374 'label' => esc_html__( 'Icon Typography', 'easy-elements' ),
375 'selector' => '{{WRAPPER}} .ee--icon-box .eel-icon',
376 ]
377 );
378
379 $this->add_group_control(
380 \Elementor\Group_Control_Border::get_type(),
381 [
382 'name' => 'icon_border',
383 'selector' => '{{WRAPPER}} .ee--icon-box .eel-icon',
384 ]
385 );
386
387 $this->add_control(
388 'icon__border_radius',
389 [
390 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
391 'type' => \Elementor\Controls_Manager::DIMENSIONS,
392 'size_units' => [ 'px', '%' ],
393 'selectors' => [
394 '{{WRAPPER}} .ee--icon-box .eel-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
395 ],
396 ]
397 );
398
399 $this->end_controls_section();
400
401 $this->start_controls_section(
402 'section_style_title',
403 [
404 'label' => esc_html__( 'Title', 'easy-elements' ),
405 'tab' => Controls_Manager::TAB_STYLE,
406 ]
407 );
408
409 $this->add_control(
410 'title_color',
411 [
412 'label' => esc_html__( 'Color', 'easy-elements' ),
413 'type' => Controls_Manager::COLOR,
414 'selectors' => [
415 '{{WRAPPER}} .icon-box-title' => 'color: {{VALUE}};',
416 ],
417 ]
418 );
419
420 $this->add_group_control(
421 \Elementor\Group_Control_Typography::get_type(),
422 [
423 'name' => 'box_title_typography',
424 'label' => esc_html__( 'Typography', 'easy-elements' ),
425 'selector' => '{{WRAPPER}} .icon-box-title',
426 ]
427 );
428
429 $this->add_responsive_control(
430 'title_margin',
431 [
432 'label' => esc_html__( 'Margin', 'easy-elements' ),
433 'type' => \Elementor\Controls_Manager::DIMENSIONS,
434 'size_units' => [ 'px', 'em', '%' ],
435 'selectors' => [
436 '{{WRAPPER}} .icon-box-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
437 ],
438 ]
439 );
440
441 $this->end_controls_section();
442
443 $this->start_controls_section(
444 'section_style_description',
445 [
446 'label' => esc_html__( 'Description', 'easy-elements' ),
447 'tab' => Controls_Manager::TAB_STYLE,
448 ]
449 );
450
451 $this->add_control(
452 'desc_color',
453 [
454 'label' => esc_html__( 'Color', 'easy-elements' ),
455 'type' => Controls_Manager::COLOR,
456 'selectors' => [
457 '{{WRAPPER}} .icon-box-description' => 'color: {{VALUE}};',
458 ],
459 ]
460 );
461
462
463 $this->add_group_control(
464 \Elementor\Group_Control_Typography::get_type(),
465 [
466 'name' => 'box_desc_typography',
467 'label' => esc_html__( 'Typography', 'easy-elements' ),
468 'selector' => '{{WRAPPER}} .icon-box-description',
469 ]
470 );
471
472
473 $this->end_controls_section();
474
475 $this->start_controls_section(
476 'section_process_number',
477 [
478 'label' => esc_html__( 'Number', 'easy-elements' ),
479 'tab' => Controls_Manager::TAB_STYLE,
480 ]
481 );
482 $this->add_control(
483 'process_number_color',
484 [
485 'label' => esc_html__( 'Color', 'easy-elements' ),
486 'type' => \Elementor\Controls_Manager::COLOR,
487 'selectors' => [
488 '{{WRAPPER}} .eel-process-number' => 'background-image:linear-gradient(180deg, {{VALUE}} 0%, rgba(255, 255, 255, 0.24) 100%);',
489 ],
490 ]
491 );
492 $this->add_group_control(
493 Group_Control_Typography::get_type(),
494 [
495 'name' => 'number_typography',
496 'label' => esc_html__('Number Typography', 'easy-elements'),
497 'selector' => '{{WRAPPER}} .eel-process-number',
498 ]
499 );
500 $this->add_responsive_control(
501 'process_number_opacity',
502 [
503 'label' => esc_html__( 'Opacity', 'easy-elements' ),
504 'type' => \Elementor\Controls_Manager::SLIDER,
505 'range' => [
506 'px' => [
507 'min' => 0, 'max' => 1, 'step' => 0.1,
508 ],
509 ],
510 'selectors' => [
511 '{{WRAPPER}} .eel-process-number' => 'opacity: {{SIZE}};',
512 ],
513 ]
514 );
515 $this->add_responsive_control(
516 'process_number_offset',
517 [
518 'label' => esc_html__( 'Number Vertical Position', 'easy-elements' ),
519 'type' => \Elementor\Controls_Manager::SLIDER,
520 'size_units' => [ 'px', '%' ],
521 'range' => [
522 'px' => [ 'min' => -500, 'max' => 500 ],
523 '%' => [ 'min' => -100, 'max' => 100 ],
524 ],
525 'selectors' => [
526 '{{WRAPPER}} .eel-process-number' => 'bottom: {{SIZE}}{{UNIT}};',
527 ],
528 ]
529 );
530 $this->add_responsive_control(
531 'process_number_offset_horizontal',
532 [
533 'label' => esc_html__( 'Number Horizontal Position', 'easy-elements' ),
534 'type' => \Elementor\Controls_Manager::SLIDER,
535 'size_units' => [ 'px', '%' ],
536 'range' => [
537 'px' => [ 'min' => -500, 'max' => 500 ],
538 '%' => [ 'min' => -100, 'max' => 100 ],
539 ],
540 'selectors' => [
541 '{{WRAPPER}} .eel-process-number' => 'left: {{SIZE}}{{UNIT}};',
542 ],
543 ]
544 );
545 $this->end_controls_section();
546 }
547
548 protected function render() {
549 $settings = $this->get_settings_for_display();
550
551 if ( empty( $settings['easy_icon_box'] ) ) {
552 return;
553 }
554 ?>
555 <div class="eel-icon-box-wrap">
556 <div class="grid-wrap">
557 <?php foreach ( $settings['easy_icon_box'] as $item ) :
558 $link = $item['link']['url'] ?? '';
559 $target = ! empty( $item['link']['is_external'] ) ? ' target="_blank"' : '';
560 $nofollow = ! empty( $item['link']['nofollow'] ) ? ' rel="nofollow"' : '';
561 $icon_direction = $settings['icon_direction'] ?? '';
562 ?>
563
564 <div class="eel-icon-item">
565 <div class="ee--icon-box <?php echo esc_attr($icon_direction); ?>">
566 <?php if ( $link ) : ?>
567 <a href="<?php echo esc_url( $link ); ?>" <?php echo esc_attr( $target ); ?> <?php echo esc_attr( $nofollow ); ?>>
568 <?php endif; ?>
569
570 <?php
571 if ( isset( $item['icon']['value'] ) && $item['icon']['value'] ) { ?>
572 <span class="eel-icon"><?php \Elementor\Icons_Manager::render_icon( $item['icon'], [ 'aria-hidden' => 'true' ] ); ?></span>
573 <?php } ?>
574
575 <?php if ( $icon_direction === 'left' || $icon_direction === 'right' ) : ?>
576 <div class="eel-title-content-wrap">
577 <?php endif; ?>
578 <?php
579 if ( $item['process_number_or_icon'] === 'p_number' && ! empty( $item['process_number'] ) ) :
580 echo '<span class="eel-process-number">' . esc_html( $item['process_number'] ) . '</span>';
581 elseif ( $item['process_number_or_icon'] === 'p_icon' && ! empty( $item['process_icon'] ) ) :
582 echo '<span class="eel-process-number">';
583 \Elementor\Icons_Manager::render_icon( $item['process_icon'], [ 'aria-hidden' => 'true' ] );
584 echo '</span>';
585 endif;
586 ?>
587 <?php if ( ! empty( $item['_title'] ) ) :
588 $title_tag = isset( $settings['title_tag'] ) ? $settings['title_tag'] : 'h3'; ?>
589 <<?php echo esc_attr( $title_tag ); ?> class="icon-box-title">
590 <?php echo wp_kses_post( $item['_title'] ); ?>
591 </<?php echo esc_attr( $title_tag ); ?>>
592 <?php endif; ?>
593
594 <?php if ( ! empty( $item['_description'] ) ) : ?>
595 <div class="icon-box-description"><?php echo wp_kses_post( $item['_description'] ); ?></div>
596 <?php endif; ?>
597
598 <?php if ( $icon_direction === 'left' || $icon_direction === 'right' ) : ?>
599 </div>
600 <?php endif; ?>
601
602 <?php if ( $link ) : ?>
603 </a>
604 <?php endif; ?>
605 </div>
606 </div>
607
608 <?php endforeach; ?>
609 </div>
610 </div>
611 <?php
612 }
613 }