PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.2.1
Easy Elements for Elementor – Addons & Website Templates v1.2.1
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-list / process-list.php

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

497 lines 19.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 use Elementor\Utils;
3 use Elementor\Controls_Manager;
4 use Elementor\Responsive_Control;
5 use Elementor\Group_Control_Image_Size;
6
7 defined( 'ABSPATH' ) || die();
8 if ( ! class_exists( 'Easyel_Process_list_Widget' ) ) {
9 class Easyel_Process_list_Widget extends \Elementor\Widget_Base {
10
11 public function get_style_depends() {
12 $handle = 'eel-process-list';
13 $css_path = plugin_dir_path( __FILE__ ) . 'css/process-list.min.css';
14
15 if ( ! wp_style_is( $handle, 'registered' ) && file_exists( $css_path ) ) {
16 wp_register_style( $handle, plugins_url( 'css/process-list.min.css', __FILE__ ), [], defined( 'WP_DEBUG' ) && WP_DEBUG ? filemtime( $css_path ) : EASYELEMENTS_VER );
17 }
18
19 return [ $handle ];
20 }
21
22 public function get_name() {
23 return 'eel-process-list';
24 }
25
26 public function get_title() {
27 return esc_html__( 'Process List', 'easy-elements' );
28 }
29
30 public function get_icon() {
31 return 'easyicon easyelIcon-process-list';
32 }
33
34 public function get_categories() {
35 return [ 'easyelements_category' ];
36 }
37
38 public function get_keywords() {
39 return [ 'process', 'sevice', 'icon', 'process-box', 'text' ];
40 }
41
42 protected function register_controls() {
43 $this->start_controls_section(
44 '_section_logo',
45 [
46 'label' => esc_html__( 'Process Settings', 'easy-elements' ),
47 'tab' => Controls_Manager::TAB_CONTENT,
48 ]
49 );
50
51 $this->add_control(
52 'icon',
53 [
54 'label' => esc_html__( 'Icon', 'easy-elements' ),
55 'type' => \Elementor\Controls_Manager::ICONS,
56 'label_block' => true,
57 'default' => [
58 'value' => 'fas fa-star',
59 'library' => 'fa-solid',
60 ],
61 ]
62 );
63
64 $this->add_control(
65 'process_title',
66 [
67 'label' => esc_html__( 'Title', 'easy-elements' ),
68 'type' => \Elementor\Controls_Manager::TEXT,
69 'default' => esc_html__( 'Initial Consultation', 'easy-elements' ),
70 'label_block' => true,
71 ]
72 );
73
74 $this->add_control(
75 '_description',
76 [
77 'label' => esc_html__( 'Description', 'easy-elements' ),
78 'type' => \Elementor\Controls_Manager::TEXTAREA,
79 'default' => esc_html__( 'We start by understanding your vision, needs, lifestyle, and budget to establish the foundation of your project.', 'easy-elements' ),
80 ]
81 );
82
83 $this->add_control(
84 'link',
85 [
86 'label' => esc_html__('Link', 'easy-elements'),
87 'type' => Controls_Manager::URL,
88 'placeholder' => 'https://example.com',
89 ]
90 );
91
92 $this->add_control(
93 'process_number',
94 [
95 'label' => esc_html__( 'Process Number', 'easy-elements' ),
96 'type' => \Elementor\Controls_Manager::TEXT,
97 'default' => '01',
98 'placeholder' => 'Enter a number',
99 ]
100 );
101
102 $this->add_control(
103 'title_tag',
104 [
105 'label' => esc_html__( 'Title HTML Tag', 'easy-elements' ),
106 'type' => \Elementor\Controls_Manager::SELECT,
107 'default' => 'h3',
108 'options' => [
109 'h1' => 'H1',
110 'h2' => 'H2',
111 'h3' => 'H3',
112 'h4' => 'H4',
113 'h5' => 'H5',
114 'h6' => 'H6',
115 'div' => 'div',
116 'span' => 'span',
117 'p' => 'p',
118 ],
119 ]
120 );
121
122 $this->add_responsive_control(
123 'flex_align_vertical',
124 [
125 'label' => esc_html__( 'Vertical Align', 'easy-elements' ),
126 'type' => \Elementor\Controls_Manager::CHOOSE,
127 'options' => [
128 'flex-start' => [
129 'title' => esc_html__( 'Top', 'easy-elements' ),
130 'icon' => 'eicon-v-align-top',
131 ],
132 'center' => [
133 'title' => esc_html__( 'Center', 'easy-elements' ),
134 'icon' => 'eicon-v-align-middle',
135 ],
136 'flex-end' => [
137 'title' => esc_html__( 'Bottom', 'easy-elements' ),
138 'icon' => 'eicon-v-align-bottom',
139 ],
140 ],
141 'default' => 'center',
142 'toggle' => true,
143 'selectors' => [
144 '{{WRAPPER}} .eel--process-list' => 'align-items: {{VALUE}};',
145 ],
146 ]
147 );
148
149 $this->add_responsive_control(
150 'item_gap',
151 [
152 'label' => esc_html__( 'Gap', 'easy-elements' ),
153 'type' => \Elementor\Controls_Manager::SLIDER,
154 'size_units' => [ 'px', 'em', 'rem' ],
155 'range' => [
156 'px' => [
157 'min' => 0,
158 'max' => 100,
159 'step' => 1,
160 ],
161 'em' => [
162 'min' => 0,
163 'max' => 10,
164 'step' => 0.1,
165 ],
166 ],
167 'default' => [
168 'size' => 64,
169 'unit' => 'px',
170 ],
171 'selectors' => [
172 '{{WRAPPER}} .eel--process-list' => 'gap: {{SIZE}}{{UNIT}};',
173 ],
174 ]
175 );
176
177 $this->end_controls_section();
178
179 $this->start_controls_section(
180 'section_style_icon',
181 [
182 'label' => esc_html__( 'Icon', 'easy-elements' ),
183 'tab' => Controls_Manager::TAB_STYLE,
184 ]
185 );
186
187 $this->add_control(
188 'icon_color',
189 [
190 'label' => esc_html__( 'Color', 'easy-elements' ),
191 'type' => Controls_Manager::COLOR,
192 'selectors' => [
193 '{{WRAPPER}} .eel--process-list .eel-process-icon' => 'color: {{VALUE}};',
194 '{{WRAPPER}} .eel--process-list .eel-process-icon svg' => 'fill: {{VALUE}};',
195 ],
196 ]
197 );
198
199 $this->add_control(
200 'icon_bg_color',
201 [
202 'label' => esc_html__( 'Background', 'easy-elements' ),
203 'type' => Controls_Manager::COLOR,
204 'selectors' => [
205 '{{WRAPPER}} .eel--process-list .eel-process-icon' => 'background-color: {{VALUE}};',
206 ],
207 ]
208 );
209
210 $this->add_group_control(
211 \Elementor\Group_Control_Background::get_type(),
212 [
213 'name' => 'icon_background',
214 'label' => esc_html__( 'Background', 'easy-elements' ),
215 'types' => [ 'classic', 'gradient' ],
216 'selector' => '{{WRAPPER}} .eel--process-list .eel-process-icon',
217 ]
218 );
219
220 $this->add_responsive_control(
221 'icon_size',
222 [
223 'label' => esc_html__( 'Icon Size', 'easy-elements' ),
224 'type' => \Elementor\Controls_Manager::SLIDER,
225 'range' => [
226 'px' => [
227 'min' => 10,
228 'max' => 76,
229 'step' => 1,
230 ],
231 ],
232 'selectors' => [
233 '{{WRAPPER}} .eel--process-list .eel-process-icon svg' => 'width: {{SIZE}}{{UNIT}};',
234 '{{WRAPPER}} .eel--process-list .eel-process-icon i' => 'font-size: {{SIZE}}{{UNIT}};',
235 ],
236 ]
237 );
238
239
240 $this->add_group_control(
241 \Elementor\Group_Control_Border::get_type(),
242 [
243 'name' => 'icon_border',
244 'selector' => '{{WRAPPER}} .eel--process-list .eel-process-icon',
245 ]
246 );
247
248 $this->add_control(
249 'icon__border_radius',
250 [
251 'label' => esc_html__( 'Border Radius', 'easy-elements' ),
252 'type' => \Elementor\Controls_Manager::DIMENSIONS,
253 'size_units' => [ 'px', '%' ],
254 'selectors' => [
255 '{{WRAPPER}} .eel--process-list .eel-process-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
256 ],
257 ]
258 );
259
260 $this->add_responsive_control(
261 'icon_padding',
262 [
263 'label' => esc_html__( 'Padding', 'easy-elements' ),
264 'type' => \Elementor\Controls_Manager::DIMENSIONS,
265 'size_units' => [ 'px', 'em', '%', 'rem' ],
266 'selectors' => [
267 '{{WRAPPER}} .eel--process-list .eel-process-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
268 ],
269 ]
270 );
271
272 $this->add_group_control(
273 \Elementor\Group_Control_Box_Shadow::get_type(),
274 [
275 'name' => 'icon_box_shadow',
276 'label' => esc_html__( 'Box Shadow', 'easy-elements' ),
277 'selector' => '{{WRAPPER}} .eel--process-list .eel-process-icon',
278 ]
279 );
280
281 $this->add_responsive_control(
282 'icon_box_size',
283 [
284 'label' => esc_html__( 'Box Size', 'easy-elements' ),
285 'type' => Controls_Manager::SLIDER,
286 'range' => [
287 'px' => [
288 'min' => 30,
289 'max' => 150,
290 ],
291 ],
292 'selectors' => [
293 '{{WRAPPER}} .eel--process-list .eel-process-icon' => 'width: {{SIZE}}{{UNIT}}; min-width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
294 ],
295 ]
296 );
297
298 $this->end_controls_section();
299
300 $this->start_controls_section(
301 'section_style_title',
302 [
303 'label' => esc_html__( 'Title', 'easy-elements' ),
304 'tab' => Controls_Manager::TAB_STYLE,
305 ]
306 );
307
308 $this->add_control(
309 'title_color',
310 [
311 'label' => esc_html__( 'Color', 'easy-elements' ),
312 'type' => Controls_Manager::COLOR,
313 'selectors' => [
314 '{{WRAPPER}} .icon-box-title' => 'color: {{VALUE}};',
315 ],
316 ]
317 );
318
319 $this->add_group_control(
320 \Elementor\Group_Control_Typography::get_type(),
321 [
322 'name' => 'box_title_typography',
323 'label' => esc_html__( 'Typography', 'easy-elements' ),
324 'selector' => '{{WRAPPER}} .icon-box-title',
325 ]
326 );
327
328 $this->add_responsive_control(
329 'title_margin',
330 [
331 'label' => esc_html__( 'Margin', 'easy-elements' ),
332 'type' => \Elementor\Controls_Manager::DIMENSIONS,
333 'size_units' => [ 'px', '%', 'em', 'rem' ],
334 'selectors' => [
335 '{{WRAPPER}} .eel--process-list .icon-box-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
336 ],
337 ]
338 );
339
340 $this->end_controls_section();
341
342 $this->start_controls_section(
343 'title_sub_style',[
344 'label' => esc_html__( 'Highlight Title', 'easy-elements' ),
345 'tab' => Controls_Manager::TAB_STYLE,
346 ]
347 );
348
349 $this->add_control(
350 'title_highlight_note',
351 [
352 'type' => \Elementor\Controls_Manager::RAW_HTML,
353 'raw' => __( 'Highlight options work only when part of the title is wrapped in a &lt;span&gt; tag.', 'easy-elements' ),
354 'content_classes' => 'elementor-control-field-description',
355 ]
356 );
357
358 $this->add_control(
359 'title_sub_color',
360 [
361 'label' => esc_html__( 'Color', 'easy-elements' ),
362 'type' => Controls_Manager::COLOR,
363 'selectors' => [
364 '{{WRAPPER}} .icon-box-title span' => 'color: {{VALUE}};',
365 ],
366 ]
367 );
368
369 $this->add_group_control(
370 \Elementor\Group_Control_Typography::get_type(),
371 [
372 'name' => 'title_sub_typography',
373 'label' => esc_html__( 'Typography', 'easy-elements' ),
374 'selector' => '{{WRAPPER}} .icon-box-title span',
375 ]
376 );
377
378 $this->add_responsive_control(
379 'title_sub_margin',
380 [
381 'label' => esc_html__( 'Margin', 'easy-elements' ),
382 'type' => \Elementor\Controls_Manager::DIMENSIONS,
383 'size_units' => [ 'px', '%', 'em', 'rem' ],
384 'selectors' => [
385 '{{WRAPPER}} .eel--process-list .icon-box-title span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
386 ],
387 ]
388 );
389
390 $this->end_controls_section();
391
392 $this->start_controls_section(
393 'section_style_description',
394 [
395 'label' => esc_html__( 'Description', 'easy-elements' ),
396 'tab' => Controls_Manager::TAB_STYLE,
397 ]
398 );
399
400 $this->add_control(
401 'desc_color',
402 [
403 'label' => esc_html__( 'Color', 'easy-elements' ),
404 'type' => Controls_Manager::COLOR,
405 'selectors' => [
406 '{{WRAPPER}} .icon-box-description' => 'color: {{VALUE}};',
407 ],
408 ]
409 );
410
411 $this->add_group_control(
412 \Elementor\Group_Control_Typography::get_type(),
413 [
414 'name' => 'box_desc_typography',
415 'label' => esc_html__( 'Typography', 'easy-elements' ),
416 'selector' => '{{WRAPPER}} .icon-box-description',
417 ]
418 );
419
420 $this->end_controls_section();
421
422 $this->start_controls_section(
423 'section_process_number',
424 [
425 'label' => esc_html__( 'Number', 'easy-elements' ),
426 'tab' => Controls_Manager::TAB_STYLE,
427 ]
428 );
429
430 $this->add_control(
431 'process_number_color',
432 [
433 'label' => esc_html__( 'Color', 'easy-elements' ),
434 'type' => \Elementor\Controls_Manager::COLOR,
435 'selectors' => [
436 '{{WRAPPER}} .eel-pro-number' => 'color: {{VALUE}};',
437 ],
438 ]
439 );
440
441 $this->add_group_control(
442 \Elementor\Group_Control_Typography::get_type(),
443 [
444 'name' => 'number_typography',
445 'label' => esc_html__( 'Typography', 'easy-elements' ),
446 'selector' => '{{WRAPPER}} .eel-pro-number',
447 ]
448 );
449
450 $this->end_controls_section();
451 }
452
453 protected function render() {
454 $settings = $this->get_settings_for_display();
455 $link = $settings['link']['url'] ?? '';
456 $target = ! empty( $settings['link']['is_external'] ) ? ' target="_blank"' : '';
457 $nofollow = ! empty( $settings['link']['nofollow'] ) ? ' rel="nofollow"' : '';
458 ?>
459 <div class="eel-process-wrap-list">
460 <?php if ( $link ) : ?>
461 <a href="<?php echo esc_url( $link ); ?>" <?php echo esc_attr( $target ); ?> <?php echo esc_attr( $nofollow ); ?>>
462 <?php endif; ?>
463 <div class="eel--process-list">
464 <?php if ( ! empty( $settings['process_number'] ) ) : ?>
465 <span class="eel-pro-number"><?php echo esc_html( $settings['process_number'] ); ?></span>
466 <?php endif; ?>
467
468 <?php
469 if ( isset( $settings['icon']['value'] ) && ! empty( $settings['icon']['value'] ) ) { ?>
470 <span class="eel-process-icon"><?php \Elementor\Icons_Manager::render_icon( $settings['icon'], [ 'aria-hidden' => 'true' ] ); ?></span>
471 <?php } ?>
472
473 <div class="eel-process-wrap">
474 <?php if ( ! empty( $settings['process_title'] ) ) :
475 $title_tag = isset( $settings['title_tag'] ) ? $settings['title_tag'] : 'h3'; ?>
476 <<?php echo esc_attr( $title_tag ); ?> class="icon-box-title">
477 <?php
478 $allowed_tags = wp_kses_allowed_html('post');
479 echo wp_kses( $settings['process_title'], $allowed_tags );
480 ?>
481 </<?php echo esc_attr( $title_tag ); ?>>
482 <?php endif; ?>
483
484 <?php if ( ! empty( $settings['_description'] ) ) : ?>
485 <div class="icon-box-description"><?php echo wp_kses_post( $settings['_description'] ); ?></div>
486 <?php endif; ?>
487 </div>
488 </div>
489 <?php if ( $link ) : ?>
490 </a>
491 <?php endif; ?>
492 </div>
493 <?php
494 }
495 }
496 }
497 ?>