PluginProbe ʕ •ᴥ•ʔ
LatePoint – Calendar Booking Plugin for Appointments and Events / 5.1.9
LatePoint – Calendar Booking Plugin for Appointments and Events v5.1.9
5.6.6 5.6.5 5.6.4 5.6.3 5.6.2 5.6.1 5.6.0 5.5.2 5.5.1 5.5.0 5.4.2 trunk 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.1.91 5.1.92 5.1.93 5.1.94 5.2.0 5.2.1 5.2.10 5.2.11 5.2.2 5.2.3 5.2.4 5.2.5 5.2.6 5.2.7 5.2.8 5.2.9 5.3.0 5.3.1 5.3.2 5.4.0 5.4.1
latepoint / blocks / elementor / elementor_widget_calendar.php
latepoint / blocks / elementor Last commit date
elementor_widget_book_button.php 1 year ago elementor_widget_book_form.php 1 year ago elementor_widget_calendar.php 1 year ago elementor_widget_customer_dashboard.php 1 year ago elementor_widget_customer_login.php 1 year ago elementor_widget_list_of_resources.php 1 year ago
elementor_widget_calendar.php
136 lines
1 <?php
2
3 class Latepoint_Elementor_Widget_Calendar extends \Elementor\Widget_Base {
4
5 protected $widget_data;
6 /**
7 * Widget base constructor
8 */
9 public function __construct( $data = [], $args = null ) {
10 $this->widget_data = $args;
11 parent::__construct( $data, $args );
12 }
13
14
15 /**
16 * Get widget name
17 */
18 public function get_name(): string {
19 return 'latepoint_calendar';
20 }
21
22 /**
23 * Get widget title
24 */
25 public function get_title(): string {
26 return esc_html__( 'Latepoint Calendar', 'latepoint' );
27 }
28
29 /**
30 * Get widget icon
31 */
32 public function get_icon(): string {
33 return 'eicon-calendar';
34 }
35
36 /**
37 * Get widget categories
38 */
39 public function get_categories(): array {
40 return [ OsElementorHelper::$category ];
41 }
42
43 /**
44 * Register widget controls
45 */
46 protected function register_controls(): void {
47
48 # Form Settings Section
49 $this->start_controls_section(
50 'content_section_form_settings',
51 [
52 'label' => esc_html__( 'Latepoint Calendar Settings', 'latepoint' ),
53 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
54 ]
55 );
56
57 $this->add_control(
58 'date',
59 [
60 'label' => esc_html__( 'Date', 'latepoint' ),
61 'type' => \Elementor\Controls_Manager::DATE_TIME,
62 'picker_options' => ['enableTime' => false],
63 'label_block' => false
64 ]
65 );
66
67 $this->add_control(
68 'show_agents',
69 [
70 'label' => esc_html__( 'Show Agents', 'latepoint' ),
71 'type' => \Elementor\Controls_Manager::SELECT2,
72 'default' => '',
73 'multiple' => true,
74 'options' => $this->widget_data['agents'],
75 ]
76 );
77
78 $this->add_control(
79 'show_services',
80 [
81 'label' => esc_html__('Show Services', 'latepoint'),
82 'type' => \Elementor\Controls_Manager::SELECT2,
83 'default' => '',
84 'options' => $this->widget_data['services'],
85 'multiple' => true
86 ]
87 );
88
89
90 $this->add_control(
91 'show_locations',
92 [
93 'label' => esc_html__( 'Show Locations', 'latepoint' ),
94 'type' => \Elementor\Controls_Manager::SELECT2,
95 'default' => '',
96 'multiple' => true,
97 'options' => $this->widget_data['locations'],
98 ]
99 );
100
101 $this->add_control(
102 'view',
103 [
104 'label' => esc_html__( 'View', 'latepoint' ),
105 'type' => \Elementor\Controls_Manager::SELECT,
106 'default' => 'month',
107 'options' => [
108 'month' => esc_html__( 'Month', 'latepoint' ),
109 'week' => esc_html__( 'Week', 'latepoint' ),
110 ],
111 ]
112 );
113
114 $this->end_controls_section();
115 }
116
117
118 /**
119 * Render widget output on the frontend
120 */
121 protected function render(): void {
122 $settings = $this->get_settings_for_display();
123
124 $allowed_params = [
125 'date',
126 'show_services',
127 'show_agents',
128 'show_locations',
129 'view'
130 ];
131
132 $params = OsBlockHelper::attributes_to_data_params($settings, $allowed_params);
133 echo do_shortcode('[latepoint_calendar ' . $params . ']');
134 }
135
136 }