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
easy-elements / widgets / process-list / process-list.php

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

490 lines 18.7 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.css';
14
15 if ( ! wp_style_is( $handle, 'registered' ) && file_exists( $css_path ) ) {
16 wp_register_style( $handle, plugins_url( 'css/process-list.css', __FILE__ ), [], defined( 'WP_DEBUG' ) && WP_DEBUG ? filemtime( $css_path ) : '1.0.0' );
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__( 'Title Sub', 'easy-elements' ),
345 'tab' => Controls_Manager::TAB_STYLE,
346 ]
347 );
348
349 $this->add_control(
350 'title_sub_color',
351 [
352 'label' => esc_html__( 'Color', 'easy-elements' ),
353 'type' => Controls_Manager::COLOR,
354 'selectors' => [
355 '{{WRAPPER}} .icon-box-title span' => 'color: {{VALUE}};',
356 ],
357 ]
358 );
359
360 $this->add_group_control(
361 \Elementor\Group_Control_Typography::get_type(),
362 [
363 'name' => 'title_sub_typography',
364 'label' => esc_html__( 'Typography', 'easy-elements' ),
365 'selector' => '{{WRAPPER}} .icon-box-title span',
366 ]
367 );
368
369 $this->add_responsive_control(
370 'title_sub_margin',
371 [
372 'label' => esc_html__( 'Margin', 'easy-elements' ),
373 'type' => \Elementor\Controls_Manager::DIMENSIONS,
374 'size_units' => [ 'px', '%', 'em', 'rem' ],
375 'selectors' => [
376 '{{WRAPPER}} .eel--process-list .icon-box-title span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
377 ],
378 ]
379 );
380
381 $this->end_controls_section();
382
383 $this->start_controls_section(
384 'section_style_description',
385 [
386 'label' => esc_html__( 'Description', 'easy-elements' ),
387 'tab' => Controls_Manager::TAB_STYLE,
388 ]
389 );
390
391 $this->add_control(
392 'desc_color',
393 [
394 'label' => esc_html__( 'Color', 'easy-elements' ),
395 'type' => Controls_Manager::COLOR,
396 'selectors' => [
397 '{{WRAPPER}} .icon-box-description' => 'color: {{VALUE}};',
398 ],
399 ]
400 );
401
402 $this->add_group_control(
403 \Elementor\Group_Control_Typography::get_type(),
404 [
405 'name' => 'box_desc_typography',
406 'label' => esc_html__( 'Typography', 'easy-elements' ),
407 'selector' => '{{WRAPPER}} .icon-box-description',
408 ]
409 );
410
411 $this->end_controls_section();
412
413 $this->start_controls_section(
414 'section_process_number',
415 [
416 'label' => esc_html__( 'Number', 'easy-elements' ),
417 'tab' => Controls_Manager::TAB_STYLE,
418 ]
419 );
420
421 $this->add_control(
422 'process_number_color',
423 [
424 'label' => esc_html__( 'Color', 'easy-elements' ),
425 'type' => \Elementor\Controls_Manager::COLOR,
426 'selectors' => [
427 '{{WRAPPER}} .eel-pro-number' => 'color: {{VALUE}};',
428 ],
429 ]
430 );
431
432 $this->add_group_control(
433 \Elementor\Group_Control_Typography::get_type(),
434 [
435 'name' => 'number_typography',
436 'label' => esc_html__( 'Typography', 'easy-elements' ),
437 'selector' => '{{WRAPPER}} .eel-pro-number',
438 ]
439 );
440
441 $this->end_controls_section();
442 }
443
444 protected function render() {
445 $settings = $this->get_settings_for_display();
446 $link = $settings['link']['url'] ?? '';
447 $target = ! empty( $settings['link']['is_external'] ) ? ' target="_blank"' : '';
448 $nofollow = ! empty( $settings['link']['nofollow'] ) ? ' rel="nofollow"' : '';
449 ?>
450 <div class="eel-process-wrap-list">
451 <div class="eel--process-list">
452 <?php if ( $link ) : ?>
453 <a href="<?php echo esc_url( $link ); ?>" <?php echo esc_attr( $target ); ?> <?php echo esc_attr( $nofollow ); ?>>
454 <?php endif; ?>
455
456 <?php if ( ! empty( $settings['process_number'] ) ) : ?>
457 <span class="eel-pro-number"><?php echo esc_html( $settings['process_number'] ); ?></span>
458 <?php endif; ?>
459
460 <?php
461 if ( isset( $settings['icon']['value'] ) && ! empty( $settings['icon']['value'] ) ) { ?>
462 <span class="eel-process-icon"><?php \Elementor\Icons_Manager::render_icon( $settings['icon'], [ 'aria-hidden' => 'true' ] ); ?></span>
463 <?php } ?>
464
465 <div class="eel-process-wrap">
466 <?php if ( ! empty( $settings['process_title'] ) ) :
467 $title_tag = isset( $settings['title_tag'] ) ? $settings['title_tag'] : 'h3'; ?>
468 <<?php echo esc_attr( $title_tag ); ?> class="icon-box-title">
469 <?php
470 $allowed_tags = wp_kses_allowed_html('post');
471 echo wp_kses( $settings['process_title'], $allowed_tags );
472 ?>
473 </<?php echo esc_attr( $title_tag ); ?>>
474 <?php endif; ?>
475
476 <?php if ( ! empty( $settings['_description'] ) ) : ?>
477 <div class="icon-box-description"><?php echo wp_kses_post( $settings['_description'] ); ?></div>
478 <?php endif; ?>
479 </div>
480
481 <?php if ( $link ) : ?>
482 </a>
483 <?php endif; ?>
484 </div>
485 </div>
486 <?php
487 }
488 }
489 }
490 ?>