PluginProbe ʕ •ᴥ•ʔ
Essential Addons for Elementor – Popular Elementor Templates & Widgets / 5.8.7
Essential Addons for Elementor – Popular Elementor Templates & Widgets v5.8.7
6.6.5 6.6.4 6.6.3 5.7.3 5.7.4 5.8.0 5.8.1 5.8.10 5.8.11 5.8.12 5.8.13 5.8.14 5.8.15 5.8.16 5.8.18 5.8.2 5.8.3 5.8.4 5.8.5 5.8.6 5.8.7 5.8.8 5.8.9 5.9.0 5.9.1 5.9.10 5.9.11 5.9.12 5.9.13 5.9.14 5.9.15 5.9.16 5.9.17 5.9.18 5.9.19 5.9.2 5.9.20 5.9.21 5.9.22 5.9.23 5.9.24 5.9.25 5.9.26 5.9.27 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9 6.0.0 6.0.1 6.0.10 6.0.11 6.0.12 6.0.13 6.0.14 6.0.15 6.0.2 6.0.3 6.0.4 6.0.5 6.0.6 6.0.7 6.0.8 6.0.9 6.1.0 6.1.1 6.1.10 6.1.11 trunk 6.1.12 1.0.0 6.1.13 1.0.1 6.1.14 1.1.0 6.1.15 2.0 6.1.17 2.1 6.1.18 2.10.0 6.1.19 2.10.1 6.1.2 2.10.2 6.1.20 2.10.3 6.1.3 2.10.4 6.1.4 2.10.5 6.1.5 2.2.0 6.1.6 2.2.1 6.1.7 2.2.2 6.1.8 2.2.3 6.1.9 2.2.4 6.2.0 2.2.5 6.2.1 2.3.0 6.2.2 2.3.1 6.2.3 2.4.0 6.2.4 2.4.1 6.3.0 2.4.2 6.3.1 2.4.3 6.3.2 2.5.0 6.3.3 2.6.0 6.4.0 2.7.0 6.5.0 2.7.1 6.5.1 2.7.10 6.5.10 2.7.11 6.5.11 2.7.2 6.5.12 2.7.3 6.5.13 2.7.4 6.5.2 2.7.5 6.5.3 2.7.6 6.5.4 2.7.7 6.5.5 2.7.8 6.5.6 2.7.9 6.5.7 2.8.0 6.5.8 2.8.1 6.5.9 2.8.2 6.6.0 2.8.3 6.6.1 2.8.4 6.6.2 2.8.5 2.8.6 2.8.7 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.4.1 3.1.5 3.2.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.5.0 3.5.1 3.5.2 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1 3.7.2 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.9.0 4.9.1 4.9.2 4.9.3 4.9.4 4.9.5 4.9.6 4.9.7 5.0.0 5.0.1 5.0.10 5.0.11 5.0.12 5.0.13 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.0.9 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.2.0 5.2.1 5.2.2 5.2.3 5.2.4 5.3.0 5.3.1 5.3.2 5.4.6 5.5.5 5.6.5 5.7.2
essential-addons-for-elementor-lite / includes / Elements / Post_Timeline.php
essential-addons-for-elementor-lite / includes / Elements Last commit date
Adv_Accordion.php 2 years ago Adv_Tabs.php 2 years ago Advanced_Data_Table.php 2 years ago Better_Payment.php 4 years ago Betterdocs_Category_Box.php 2 years ago Betterdocs_Category_Grid.php 2 years ago Betterdocs_Search_Form.php 2 years ago Business_Reviews.php 2 years ago Caldera_Forms.php 2 years ago Career_Page.php 4 years ago Contact_Form_7.php 2 years ago Content_Ticker.php 2 years ago Countdown.php 2 years ago Creative_Button.php 2 years ago Crowdfundly_All_Campaign.php 4 years ago Crowdfundly_Organization.php 4 years ago Crowdfundly_Single_Campaign.php 4 years ago Cta_Box.php 2 years ago Data_Table.php 2 years ago Dual_Color_Header.php 2 years ago EmbedPress.php 4 years ago Event_Calendar.php 2 years ago Facebook_Feed.php 2 years ago Fancy_Text.php 2 years ago Feature_List.php 2 years ago Filterable_Gallery.php 2 years ago Flip_Box.php 2 years ago FluentForm.php 2 years ago Formstack.php 2 years ago GravityForms.php 2 years ago Image_Accordion.php 2 years ago Info_Box.php 2 years ago Interactive_Circle.php 2 years ago Login_Register.php 2 years ago NFT_Gallery.php 2 years ago NinjaForms.php 2 years ago Post_Grid.php 2 years ago Post_Timeline.php 2 years ago Pricing_Table.php 2 years ago Product_Grid.php 2 years ago Progress_Bar.php 2 years ago SVG_Draw.php 3 years ago Simple_Menu.php 2 years ago Sticky_Video.php 2 years ago Team_Member.php 2 years ago Testimonial.php 2 years ago Tooltip.php 2 years ago Twitter_Feed.php 2 years ago TypeForm.php 2 years ago WeForms.php 2 years ago Woo_Cart.php 2 years ago Woo_Checkout.php 2 years ago Woo_Product_Carousel.php 2 years ago Woo_Product_Compare.php 4 years ago Woo_Product_Gallery.php 2 years ago Woocommerce_Review.php 4 years ago WpForms.php 2 years ago index.php 3 years ago
Post_Timeline.php
802 lines
1 <?php
2
3 namespace Essential_Addons_Elementor\Elements;
4
5 // If this file is called directly, abort.
6 if (!defined('ABSPATH')) {
7 exit;
8 }
9
10 use \Elementor\Controls_Manager;
11 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
12 use Elementor\Group_Control_Box_Shadow;
13 use \Elementor\Group_Control_Typography;
14 use \Elementor\Widget_Base;
15 use \Essential_Addons_Elementor\Classes\Helper as HelperClass;
16 use Essential_Addons_Elementor\Traits\Helper;
17
18 class Post_Timeline extends Widget_Base
19 {
20 use Helper;
21
22 protected $page_id;
23
24 public function get_name()
25 {
26 return 'eael-post-timeline';
27 }
28
29 public function get_title()
30 {
31 return __('Post Timeline', 'essential-addons-for-elementor-lite');
32 }
33
34 public function get_icon()
35 {
36 return 'eaicon-post-timeline';
37 }
38
39 public function get_categories()
40 {
41 return ['essential-addons-for-elementor-lite'];
42 }
43
44 public function get_keywords()
45 {
46 return [
47 'post',
48 'posts',
49 'timeline',
50 'ea post timeline',
51 'ea posts timeline',
52 'blog posts',
53 'content marketing',
54 'blogger',
55 'ea',
56 'essential addons',
57 ];
58 }
59
60 public function get_custom_help_url()
61 {
62 return 'https://essential-addons.com/elementor/docs/post-timeline/';
63 }
64
65 protected function register_controls()
66 {
67
68 /**
69 * Query And Layout Controls!
70 * @source includes/elementor-helper.php
71 */
72 do_action('eael/controls/query', $this);
73 do_action('eael/controls/layout', $this);
74
75 $this->start_controls_section(
76 'section_post_timeline_links',
77 [
78 'label' => __('Links', 'essential-addons-for-elementor-lite'),
79 ]
80 );
81
82 $this->add_control(
83 'timeline_link_nofollow',
84 [
85 'label' => __('No Follow', 'essential-addons-for-elementor-lite'),
86 'type' => Controls_Manager::SWITCHER,
87 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
88 'label_off' => __('No', 'essential-addons-for-elementor-lite'),
89 'return_value' => 'true',
90 ]
91 );
92
93 $this->add_control(
94 'timeline_link_target_blank',
95 [
96 'label' => __('Target Blank', 'essential-addons-for-elementor-lite'),
97 'type' => Controls_Manager::SWITCHER,
98 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
99 'label_off' => __('No', 'essential-addons-for-elementor-lite'),
100 'return_value' => 'true',
101 ]
102 );
103
104 $this->end_controls_section();
105
106 if (!apply_filters('eael/pro_enabled', false)) {
107 HelperClass::go_premium($this);
108 }
109
110 $this->start_controls_section(
111 'eael_section_post_timeline_style',
112 [
113 'label' => __('Timeline Style', 'essential-addons-for-elementor-lite'),
114 'tab' => Controls_Manager::TAB_STYLE,
115 ]
116 );
117
118 $this->add_control(
119 'eael_timeline_display_overlay',
120 [
121 'label' => __('Show Overlay', 'essential-addons-for-elementor-lite'),
122 'type' => Controls_Manager::SWITCHER,
123 'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
124 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
125 'return_value' => 'yes',
126 'default' => 'yes',
127 'selectors' => [
128 '{{WRAPPER}} .eael-timeline-post-image' => 'opacity: .6',
129 ],
130 'condition'=> [
131 'eael_dynamic_template_Layout!' => 'card',
132 ]
133 ]
134 );
135
136 $this->add_control(
137 'eael_timeline_overlay_color',
138 [
139 'label' => __('Overlay Color', 'essential-addons-for-elementor-lite'),
140 'type' => Controls_Manager::COLOR,
141 'description' => __('Leave blank or Clear to use default gradient overlay', 'essential-addons-for-elementor-lite'),
142 'default' => 'linear-gradient(45deg, #3f3f46 0%, #05abe0 100%) repeat scroll 0 0 rgba(0, 0, 0, 0)',
143 'selectors' => [
144 '{{WRAPPER}} .eael-timeline-post-inner' => 'background: {{VALUE}}',
145 ],
146 'condition' => [
147 'eael_timeline_display_overlay' => 'yes',
148 'eael_dynamic_template_Layout!' => 'card',
149 ],
150 ]
151 );
152
153
154 $this->add_control(
155 'eael_timeline_bg_color',
156 [
157 'label' => __('Background Color', 'essential-addons-for-elementor-lite'),
158 'type' => Controls_Manager::COLOR,
159 'default' => '#3DB1C0',
160 'selectors' => [
161 '{{WRAPPER}} .eael-timeline-post-inner' => 'background: {{VALUE}}',
162 ],
163 'condition' => [
164 'eael_dynamic_template_Layout' => 'card',
165 ],
166 ]
167 );
168
169 $this->add_responsive_control(
170 'eael_post_grid_spacing',
171 [
172 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
173 'type' => Controls_Manager::DIMENSIONS,
174 'size_units' => ['px', '%', 'em'],
175 'selectors' => [
176 '{{WRAPPER}} .eael-timeline-post-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
177 ],
178 'condition' => [
179 'eael_dynamic_template_Layout' => 'card',
180 ],
181 ]
182 );
183
184 $this->add_control(
185 'eael_post_timeline_border_radius',
186 [
187 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
188 'type' => Controls_Manager::DIMENSIONS,
189 'selectors' => [
190 '{{WRAPPER}} .eael-timeline-post-inner' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
191 ],
192 'condition' => [
193 'eael_dynamic_template_Layout' => 'card',
194 ],
195 ]
196 );
197
198 $this->add_group_control(
199 Group_Control_Box_Shadow::get_type(),
200 [
201 'name' => 'eael_post_timeline_box_shadow',
202 'selector' => '{{WRAPPER}} .eael-timeline-post-inner',
203 'condition' => [
204 'eael_dynamic_template_Layout' => 'card',
205 ],
206 ]
207 );
208
209 $this->add_control(
210 'eael_post_timeline_content_heading',
211 [
212 'label' => esc_html__('Content', 'essential-addons-for-elementor-lite'),
213 'type' => Controls_Manager::HEADING,
214 'condition' => [
215 'eael_dynamic_template_Layout' => 'card',
216 ],
217 'separator' => 'before',
218 ]
219 );
220
221 $this->add_responsive_control(
222 'eael_post_timeline_content_spacing',
223 [
224 'label' => esc_html__('Spacing', 'essential-addons-for-elementor-lite'),
225 'type' => Controls_Manager::DIMENSIONS,
226 'size_units' => ['px', '%', 'em'],
227 'selectors' => [
228 '{{WRAPPER}} .eael-timeline-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
229 ],
230 'condition' => [
231 'eael_dynamic_template_Layout' => 'card',
232 ],
233 ]
234 );
235
236 $this->add_control(
237 'eael_post_timeline_image_heading',
238 [
239 'label' => esc_html__('Image', 'essential-addons-for-elementor-lite'),
240 'type' => Controls_Manager::HEADING,
241 'separator' => 'before',
242 'condition' => [
243 'eael_dynamic_template_Layout!' => 'default',
244 ],
245 ]
246 );
247
248 $this->add_responsive_control(
249 'eael_timeline_image_height',
250 [
251 'label' => esc_html__('Height', 'essential-addons-for-elementor-lite'),
252 'type' => Controls_Manager::SLIDER,
253 'range' => [
254 'px' => [
255 'max' => 500,
256 ],
257 ],
258 'selectors' => [
259 '{{WRAPPER}} .eael-timeline-post-image' => 'height: {{SIZE}}PX;',
260 ],
261 'condition' => [
262 'eael_dynamic_template_Layout!' => 'default',
263 ],
264 ]
265 );
266
267 $this->add_control(
268 'eael_timeline_img_border_radius',
269 [
270 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
271 'type' => Controls_Manager::DIMENSIONS,
272 'size_units' => ['px', '%'],
273 'selectors' => [
274 '{{WRAPPER}} .eael-timeline-post-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
275 ],
276 'condition' => [
277 'eael_dynamic_template_Layout!' => 'default',
278 ],
279 ]
280 );
281
282 $this->end_controls_section();
283
284 $this->start_controls_section(
285 'eael_section_typography',
286 [
287 'label' => __('Typography', 'essential-addons-for-elementor-lite'),
288 'tab' => Controls_Manager::TAB_STYLE,
289 ]
290 );
291
292 $this->add_control(
293 'eael_timeline_title_style',
294 [
295 'label' => __('Title Style', 'essential-addons-for-elementor-lite'),
296 'type' => Controls_Manager::HEADING,
297 'separator' => 'before',
298 ]
299 );
300
301 $this->add_control(
302 'eael_timeline_title_color',
303 [
304 'label' => __('Title Color', 'essential-addons-for-elementor-lite'),
305 'type' => Controls_Manager::COLOR,
306 'default' => '#fff',
307 'selectors' => [
308 '{{WRAPPER}} .eael-timeline-post-title .eael-timeline-post-title-text' => 'color: {{VALUE}};',
309 '{{WRAPPER}} .timeline-layout-card .eael-timeline-post-title .eael-timeline-post-title-text-card' => 'color: {{VALUE}};',
310 ],
311
312 ]
313 );
314
315 $this->add_responsive_control(
316 'eael_timeline_title_alignment',
317 [
318 'label' => __('Title Alignment', 'essential-addons-for-elementor-lite'),
319 'type' => Controls_Manager::CHOOSE,
320 'options' => [
321 'left' => [
322 'title' => __('Left', 'essential-addons-for-elementor-lite'),
323 'icon' => 'eicon-text-align-left',
324 ],
325 'center' => [
326 'title' => __('Center', 'essential-addons-for-elementor-lite'),
327 'icon' => 'eicon-text-align-center',
328 ],
329 'right' => [
330 'title' => __('Right', 'essential-addons-for-elementor-lite'),
331 'icon' => 'eicon-text-align-right',
332 ],
333 ],
334 'selectors' => [
335 '{{WRAPPER}} .eael-timeline-post-title .eael-timeline-post-title-text' => 'text-align: {{VALUE}};',
336 ],
337 ]
338 );
339
340 $this->add_group_control(
341 Group_Control_Typography::get_type(),
342 [
343 'name' => 'eael_timeline_title_typography',
344 'label' => __('Title Typography', 'essential-addons-for-elementor-lite'),
345 'global' => [
346 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
347 ],
348 'selector' => '{{WRAPPER}} .eael-timeline-post-title .eael-timeline-post-title-text',
349 ]
350 );
351
352 $this->add_control(
353 'eael_timeline_excerpt_style',
354 [
355 'label' => __('Excerpt Style', 'essential-addons-for-elementor-lite'),
356 'type' => Controls_Manager::HEADING,
357 'separator' => 'before',
358 ]
359 );
360
361 $this->add_control(
362 'eael_timeline_excerpt_color',
363 [
364 'label' => __('Excerpt Color', 'essential-addons-for-elementor-lite'),
365 'type' => Controls_Manager::COLOR,
366 'default' => '#ffffff',
367 'selectors' => [
368 '{{WRAPPER}} .eael-timeline-post-excerpt p' => 'color: {{VALUE}};',
369 ],
370 ]
371 );
372
373 $this->add_responsive_control(
374 'eael_timeline_excerpt_alignment',
375 [
376 'label' => __('Excerpt Alignment', 'essential-addons-for-elementor-lite'),
377 'type' => Controls_Manager::CHOOSE,
378 'options' => [
379 'left' => [
380 'title' => __('Left', 'essential-addons-for-elementor-lite'),
381 'icon' => 'eicon-text-align-left',
382 ],
383 'center' => [
384 'title' => __('Center', 'essential-addons-for-elementor-lite'),
385 'icon' => 'eicon-text-align-center',
386 ],
387 'right' => [
388 'title' => __('Right', 'essential-addons-for-elementor-lite'),
389 'icon' => 'eicon-text-align-right',
390 ],
391 'justify' => [
392 'title' => __('Justified', 'essential-addons-for-elementor-lite'),
393 'icon' => 'eicon-text-align-justify',
394 ],
395 ],
396 'selectors' => [
397 '{{WRAPPER}} .eael-timeline-post-excerpt p' => 'text-align: {{VALUE}};',
398 ],
399 ]
400 );
401
402 $this->add_group_control(
403 Group_Control_Typography::get_type(),
404 [
405 'name' => 'eael_timeline_excerpt_typography',
406 'label' => __('Excerpt Typography', 'essential-addons-for-elementor-lite'),
407 'global' => [
408 'default' => Global_Typography::TYPOGRAPHY_TEXT,
409 ],
410 'selector' => '{{WRAPPER}} .eael-timeline-post-excerpt p',
411 ]
412 );
413
414 $this->end_controls_section();
415
416 // Start Arrow Styling
417
418 $this->start_controls_section(
419 'eael_section_arrow',
420 [
421 'label' => __('Arrow', 'essential-addons-for-elementor-lite'),
422 'tab' => Controls_Manager::TAB_STYLE,
423 ]
424 );
425
426 $this->add_control(
427 'eael_timeline_border_color',
428 [
429 'label' => __('Border & Arrow Color', 'essential-addons-for-elementor-lite'),
430 'type' => Controls_Manager::COLOR,
431 'default' => '#e5eaed',
432 'selectors' => [
433 '{{WRAPPER}} .eael-timeline-post-inner' => 'border-color: {{VALUE}};',
434 '{{WRAPPER}} .eael-timeline-post-inner::after' => 'border-left-color: {{VALUE}};',
435 '{{WRAPPER}} .eael-timeline-post:nth-child(2n) .eael-timeline-post-inner::after' => 'border-right-color: {{VALUE}};',
436 ],
437 'condition' => [
438 'eael_dynamic_template_Layout' => 'default',
439 ],
440 ]
441 );
442
443 $this->add_control(
444 'eael_timeline_arrow_color',
445 [
446 'label' => __('Arrow Color', 'essential-addons-for-elementor-lite'),
447 'type' => Controls_Manager::COLOR,
448 'default' => '#3DB1C0',
449 'selectors' => [
450 '{{WRAPPER}} .eael-timeline-post-inner' => 'border-color: {{VALUE}};',
451 '{{WRAPPER}} .eael-timeline-post-inner::after' => 'border-left-color: {{VALUE}}; border-right-color: {{VALUE}}',
452 // '{{WRAPPER}} .eael-timeline-post:nth-child(2n) .eael-timeline-post-inner::after' => 'border-right-color: {{VALUE}};',
453 ],
454 'condition' => [
455 'eael_dynamic_template_Layout!' => 'default',
456 ],
457 ]
458 );
459
460 $this->add_responsive_control(
461 'eael_timeline_arrow_size',
462 [
463 'label' => esc_html__('Size', 'essential-addons-for-elementor-lite'),
464 'type' => Controls_Manager::SLIDER,
465 'range' => [
466 'px' => [
467 'max' => 20,
468 ],
469 ],
470 'selectors' => [
471 '{{WRAPPER}} .eael-post-timeline.timeline-layout-card .eael-timeline-post-inner:after' => 'border-width: {{SIZE}}px; right: -{{SIZE}}px; left: -{{SIZE}}px',
472 '{{WRAPPER}} .eael-post-timeline.timeline-layout-card .eael-timeline-post:nth-child(2n) .eael-timeline-post-inner:after' => 'left: -{{SIZE}}px;',
473 ],
474
475 'condition' => [
476 'eael_dynamic_template_Layout!' => 'default',
477 ],
478 ]
479 );
480
481 $this->add_control(
482 'eael_timeline_arrow_alignment',
483 [
484 'label' => __('Alignment', 'essential-addons-for-elementor-lite'),
485 'type' => Controls_Manager::CHOOSE,
486 'options' => [
487 'top' => [
488 'title' => __( 'Top', 'essential-addons-for-elementor-lite' ),
489 'icon' => 'eicon-v-align-top',
490 ],
491 'middle' => [
492 'title' => __( 'Middle', 'essential-addons-for-elementor-lite' ),
493 'icon' => 'eicon-v-align-middle',
494 ],
495 'bottom' => [
496 'title' => __( 'Bottom', 'essential-addons-for-elementor-lite' ),
497 'icon' => 'eicon-v-align-bottom',
498 ],
499 ],
500 'default' => 'top',
501 'condition' => [
502 'eael_dynamic_template_Layout!' => 'default',
503 ],
504 ]
505 );
506
507 $this->end_controls_section();
508
509 // Start Time Styling
510
511 $this->start_controls_section(
512 'eael_section_time',
513 [
514 'label' => __('Time', 'essential-addons-for-elementor-lite'),
515 'tab' => Controls_Manager::TAB_STYLE,
516 ]
517 );
518
519 $this->add_control(
520 'eael_timeline_date_background_color',
521 [
522 'label' => __('Date Background Color', 'essential-addons-for-elementor-lite'),
523 'type' => Controls_Manager::COLOR,
524 'default' => 'rgba(0, 0, 0, 0.7)',
525 'selectors' => [
526 '{{WRAPPER}} .eael-timeline-post time' => 'background-color: {{VALUE}};',
527 '{{WRAPPER}} .eael-timeline-post time::before' => 'border-bottom-color: {{VALUE}};',
528 ],
529
530 ]
531 );
532
533 $this->add_control(
534 'eael_timeline_date_color',
535 [
536 'label' => __('Date Text Color', 'essential-addons-for-elementor-lite'),
537 'type' => Controls_Manager::COLOR,
538 'default' => '#fff',
539 'selectors' => [
540 '{{WRAPPER}} .eael-timeline-post time' => 'color: {{VALUE}};',
541 ],
542
543 ]
544 );
545
546 $this->add_group_control(
547 Group_Control_Typography::get_type(),
548 [
549 'name' => 'eael_timeline_time_typography',
550 'label' => __('Typography', 'essential-addons-for-elementor-lite'),
551 'selector' => '{{WRAPPER}} time',
552 ]
553 );
554
555 $this->add_control(
556 'eael_timeline_time_padding',
557 [
558 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
559 'type' => Controls_Manager::DIMENSIONS,
560 'size_units' => ['px', '%'],
561 'selectors' => [
562 '{{WRAPPER}} time' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
563 ],
564 ]
565 );
566
567 $this->add_control(
568 'eael_timeline_time_border_radius',
569 [
570 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
571 'type' => Controls_Manager::DIMENSIONS,
572 'size_units' => ['px', '%'],
573 'selectors' => [
574 '{{WRAPPER}} time' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
575 ],
576 ]
577 );
578
579 $this->end_controls_section();
580
581 $this->start_controls_section(
582 'eael_section_line',
583 [
584 'label' => __('Line & Bullet', 'essential-addons-for-elementor-lite'),
585 'tab' => Controls_Manager::TAB_STYLE,
586 ]
587 );
588
589 $this->add_control(
590 'eael_section_post_timeline_line_heading',
591 [
592 'label' => __('Line', 'essential-addons-for-elementor-lite'),
593 'type' => Controls_Manager::HEADING,
594 'separator' => 'before',
595 ]
596 );
597
598 $this->add_control(
599 'eael_section_post_timeline_line_size',
600 [
601 'label' => __('Line Width', 'essential-addons-for-elementor-lite'),
602 'type' => Controls_Manager::SLIDER,
603 'size_units' => ['px', '%'],
604 'range' => [
605 'px' => [
606 'min' => 0,
607 'max' => 20,
608 'step' => 1,
609 ],
610 ],
611 'selectors' => [
612 '{{WRAPPER}} .eael-timeline-post:after' => 'width: {{SIZE}}{{UNIT}};',
613 ],
614 ]
615 );
616 $this->add_control(
617 'eael_section_post_timeline_line_position_from_right',
618 [
619 'label' => __('Line Position From Right', 'essential-addons-for-elementor-lite'),
620 'type' => Controls_Manager::SLIDER,
621 'size_units' => ['px'],
622 'range' => [
623 'px' => [
624 'min' => 0,
625 'max' => 20,
626 'step' => 1,
627 ],
628 ],
629 'selectors' => [
630 '{{WRAPPER}} .eael-timeline-post:after' => 'right: -{{SIZE}}{{UNIT}};',
631 ],
632 'condition'=> [
633 'eael_dynamic_template_Layout!' => 'card',
634 ]
635 ]
636 );
637
638 $this->add_control(
639 'eael_section_post_timeline_bullet_size',
640 [
641 'label' => __('Bullet Size', 'essential-addons-for-elementor-lite'),
642 'type' => Controls_Manager::SLIDER,
643 'size_units' => ['px', '%'],
644 'range' => [
645 'px' => [
646 'min' => 0,
647 'max' => 100,
648 'step' => 1,
649 ],
650 ],
651 'selectors' => [
652 '{{WRAPPER}} .eael-timeline-bullet' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
653 ],
654 ]
655 );
656 $this->add_control(
657 'eael_section_post_timeline_bullet_position_from_left',
658 [
659 'label' => __('Left-sided Bullet Positon', 'essential-addons-for-elementor-lite'),
660 'type' => Controls_Manager::SLIDER,
661 'size_units' => ['px'],
662 'range' => [
663 'px' => [
664 'min' => 0,
665 'max' => 50,
666 'step' => 1,
667 ],
668 ],
669 'selectors' => [
670 '{{WRAPPER}} .eael-timeline-bullet' => 'right: -{{SIZE}}{{UNIT}};',
671 ],
672 'condition'=> [
673 'eael_dynamic_template_Layout!' => 'card',
674 ]
675 ]
676 );
677 $this->add_control(
678 'eael_section_post_timeline_bullet_position_from_right',
679 [
680 'label' => __('Right-sided Bullet Position', 'essential-addons-for-elementor-lite'),
681 'type' => Controls_Manager::SLIDER,
682 'size_units' => ['px'],
683 'range' => [
684 'px' => [
685 'min' => 0,
686 'max' => 50,
687 'step' => 1,
688 ],
689 ],
690 'selectors' => [
691 '{{WRAPPER}} .eael-timeline-post:nth-child(2n) .eael-timeline-bullet' => 'left: -{{SIZE}}{{UNIT}};',
692 ],
693 'condition'=> [
694 'eael_dynamic_template_Layout!' => 'card',
695 ]
696 ]
697 );
698
699 $this->add_control(
700 'eael_timeline_bullet_color',
701 [
702 'label' => __('Timeline Bullet Color', 'essential-addons-for-elementor-lite'),
703 'type' => Controls_Manager::COLOR,
704 'default' => '#9fa9af',
705 'selectors' => [
706 '{{WRAPPER}} .eael-timeline-bullet' => 'background-color: {{VALUE}};',
707 ],
708
709 ]
710 );
711
712 $this->add_control(
713 'eael_timeline_bullet_border_color',
714 [
715 'label' => __('Timeline Bullet Border Color', 'essential-addons-for-elementor-lite'),
716 'type' => Controls_Manager::COLOR,
717 'default' => '#fff',
718 'selectors' => [
719 '{{WRAPPER}} .eael-timeline-bullet' => 'border-color: {{VALUE}};',
720 ],
721
722 ]
723 );
724
725 $this->add_control(
726 'eael_timeline_vertical_line_color',
727 [
728 'label' => __('Timeline Vertical Line Color', 'essential-addons-for-elementor-lite'),
729 'type' => Controls_Manager::COLOR,
730 'default' => 'rgba(83, 85, 86, .2)',
731 'selectors' => [
732 '{{WRAPPER}} .eael-timeline-post:after' => 'background-color: {{VALUE}};',
733 ],
734
735 ]
736 );
737
738 $this->end_controls_section();
739
740 do_action('eael/controls/load_more_button_style', $this);
741
742 }
743
744 protected function render()
745 {
746 $settings = $this->get_settings_for_display();
747 $settings = HelperClass::fix_old_query($settings);
748 $args = HelperClass::get_query_args($settings);
749 $args = HelperClass::get_dynamic_args($settings, $args);
750
751 $settings ['expanison_indicator'] = $settings['excerpt_expanison_indicator'];
752
753 $this->add_render_attribute(
754 'eael_post_timeline_wrapper',
755 [
756 'id' => "eael-post-timeline-{$this->get_id()}",
757 'class' => ["eael-post-timeline", "timeline-layout-{$settings['eael_dynamic_template_Layout']}", "eael-post-timeline-arrow-{$settings['eael_timeline_arrow_alignment']}"],
758 ]
759 );
760
761 $this->add_render_attribute(
762 'eael_post_timeline',
763 [
764 'class' => ['eael-post-timeline', 'eael-post-appender', "eael-post-appender-{$this->get_id()}"],
765 ]
766 );
767
768 echo '<div ' . $this->get_render_attribute_string('eael_post_timeline_wrapper') . '>
769 <div ' . $this->get_render_attribute_string('eael_post_timeline') . '>';
770
771 $template = $this->get_template($this->get_settings('eael_dynamic_template_Layout'));
772 $settings['loadable_file_name'] = $this->get_filename_only($template);
773 $dir_name = $this->get_temp_dir_name($settings['loadable_file_name']);
774 $found_posts = 0;
775
776 if(file_exists($template)){
777 $query = new \WP_Query($args);
778 if ($query->have_posts()) {
779 $found_posts = $query->found_posts;
780 $ppp = empty( $args['posts_per_page'] ) ? get_option( 'posts_per_page' ) : $args['posts_per_page'];
781 $max_page = ceil( $found_posts / absint( $ppp ) );
782 $args['max_page'] = $max_page;
783 while ($query->have_posts()) {
784 $query->the_post();
785 include($template);
786 }
787 } else {
788 _e('<p class="no-posts-found">No posts found!</p>', 'essential-addons-for-elementor-lite');
789 }
790 wp_reset_postdata();
791 } else {
792 _e('<p class="no-posts-found">No layout found!</p>', 'essential-addons-for-elementor-lite');
793 }
794 echo '</div>
795 </div>';
796
797 if ( $found_posts > $args['posts_per_page'] ) {
798 $this->print_load_more_button( $settings, $args, $dir_name );
799 }
800 }
801 }
802