PluginProbe
Easy Hotel – Powerful Hotel Booking / 2.0.2
Easy Hotel – Powerful Hotel Booking v2.0.2
2.0.8 2.0.7 2.0.6 2.0.5 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0 1.9.9 1.9.8 1.9.7 1.9.6 1.9.5 1.9.4 1.9.3 1.9.2 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 All 110 releases
easy-hotel / public / includes / widgets / availability-calendar / availability-calendar.php

availability-calendar.php in Easy Hotel – Powerful Hotel Booking 2.0.2, at public/includes/widgets/availability-calendar/availability-calendar.php

393 lines 16.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * eshb_availability_calendar Widget
4 *
5 */
6 use Elementor\Group_Control_Text_Shadow;
7 use Elementor\Utils;
8 use Elementor\Control_Media;
9 use Elementor\Controls_Manager;
10 use Elementor\Group_Control_Border;
11 use Elementor\Group_Control_Box_Shadow;
12 use Elementor\Group_Control_Typography;
13 use Elementor\Group_Control_Background;
14
15 defined( 'ABSPATH' ) || die();
16
17 class Eshb_Availability_Calendar_Widget extends \Elementor\Widget_Base {
18
19 /**
20 * Get widget name.
21 *
22 * Retrieve widget name.
23 *
24 * @since 1.0.0
25 * @access public
26 *
27 * @return string Widget name.
28 */
29
30 public function get_name() {
31 return 'eshb_availability_calendar';
32 }
33
34
35 /**
36 * Get widget title.
37 *
38 * @since 1.0.0
39 * @access public
40 *
41 * @return string Widget title.
42 */
43 public function get_title() {
44 return esc_html__( 'Easy Hotel Availability Calendar', 'easy-hotel' );
45 }
46
47 /**
48 * Get widget icon.
49 *
50 * @since 1.0.0
51 * @access public
52 *
53 * @return string Widget icon.
54 */
55 public function get_icon() {
56 return 'easy-hotel-widget-icon';
57 }
58
59
60 public function get_categories() {
61 return [ 'easy_hotel_category' ];
62 }
63
64 protected function register_controls() {
65
66
67 $this->start_controls_section(
68 'eshb_availability_calendar_container_style',
69 [
70 'label' => esc_html__( 'Container', 'easy-hotel' ),
71 'tab' => Controls_Manager::TAB_STYLE,
72 ]
73 );
74 $this->add_control(
75 'eshb_availability_calendar_container_bg_style',
76 [
77 'type' => Controls_Manager::HEADING,
78 'label' => esc_html__( 'Background', 'easy-hotel' ),
79 'separator' => 'before',
80 ]
81 );
82 $this->add_group_control(
83 \Elementor\Group_Control_Background::get_type(),
84 [
85 'name' => 'eshb_availability_calendar_container_background',
86 'types' => [ 'classic', 'gradient', 'video' ],
87 'selector' => '{{WRAPPER}} .eshb-availability-calendars-area',
88 ]
89 );
90
91 $this->add_responsive_control(
92 'eshb_availability_calendar_container_padding',
93 [
94 'label' => esc_html__( 'Padding', 'easy-hotel' ),
95 'type' => Controls_Manager::DIMENSIONS,
96 'size_units' => [ 'px', 'em', '%' ],
97 'selectors' => [
98 '{{WRAPPER}} .eshb-availability-calendars-area' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
99 ],
100 ]
101 );
102 $this->add_control(
103 'eshb_availability_calendar_container_border_radius',
104 [
105 'label' => esc_html__( 'Border Radius', 'easy-hotel' ),
106 'type' => Controls_Manager::DIMENSIONS,
107 'size_units' => [ 'px', '%' ],
108 'selectors' => [
109 '{{WRAPPER}} .eshb-availability-calendars-area' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
110 ],
111 ]
112 );
113 $this->end_controls_section();
114
115
116 $this->start_controls_section(
117 'eshb_availability_calendar_style',
118 [
119 'label' => esc_html__( 'Calendar', 'easy-hotel' ),
120 'tab' => Controls_Manager::TAB_STYLE,
121 ]
122 );
123 $this->add_control(
124 'eshb_availability_calendar_title_styles',
125 [
126 'type' => Controls_Manager::HEADING,
127 'label' => esc_html__( 'Calendar Title', 'easy-hotel' ),
128 'separator' => 'before',
129 ]
130 );
131 $this->add_control(
132 'eshb_availability_calendar_title_color',
133 [
134 'label' => esc_html__( 'Color', 'easy-hotel' ),
135 'type' => Controls_Manager::COLOR,
136 'selectors' => [
137 '{{WRAPPER}} .eshb-availability-calendars-area .calendar-title' => 'color: {{VALUE}};',
138 ],
139 ]
140 );
141 $this->add_control(
142 'eshb_availability_calendar_background',
143 [
144 'label' => esc_html__( 'Background Color', 'easy-hotel' ),
145 'type' => Controls_Manager::COLOR,
146 'selectors' => [
147 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker' => 'background-color: {{VALUE}};',
148 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker::before' => 'border-bottom-color: {{VALUE}};',
149 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker::after' => 'border-bottom-color: {{VALUE}};',
150 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker .calendar-table' => 'background-color: {{VALUE}};',
151 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker td.off' => 'background-color: {{VALUE}};',
152 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker td.off.in-range' => 'background-color: {{VALUE}};',
153 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker td.off.start-date' => 'background-color: {{VALUE}};',
154 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker td.off.end-date' => 'background-color: {{VALUE}};',
155 ],
156 ]
157 );
158 $this->add_control(
159 'eshb_availability_calendar_border_color',
160 [
161 'label' => esc_html__( 'Border Color', 'easy-hotel' ),
162 'type' => Controls_Manager::COLOR,
163 'selectors' => [
164 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker .calendar-table' => 'border-color: {{VALUE}};',
165 ],
166 ]
167 );
168
169 $this->add_control(
170 'eshb_availability_calendar_table_styles',
171 [
172 'type' => Controls_Manager::HEADING,
173 'label' => esc_html__( 'Table', 'easy-hotel' ),
174 'separator' => 'before',
175 ]
176 );
177 $this->add_control(
178 'eshb_availability_calendar_table_heading_color',
179 [
180 'label' => esc_html__( 'Heading Color', 'easy-hotel' ),
181 'type' => Controls_Manager::COLOR,
182 'selectors' => [
183 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker th' => 'color: {{VALUE}};',
184 ],
185 ]
186 );
187 $this->add_control(
188 'eshb_availability_calendar_table_date_color',
189 [
190 'label' => esc_html__( 'Date Color', 'easy-hotel' ),
191 'type' => Controls_Manager::COLOR,
192 'selectors' => [
193 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker td' => 'color: {{VALUE}};',
194 ],
195 ]
196 );
197
198 $this->add_control(
199 'eshb_availability_calendar_table_date_active_color',
200 [
201 'label' => esc_html__( 'Date Active Color', 'easy-hotel' ),
202 'type' => Controls_Manager::COLOR,
203 'selectors' => [
204 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker td.active' => 'color: {{VALUE}} !important;',
205 ],
206 ]
207 );
208
209 $this->add_control(
210 'eshb_availability_calendar_table_date_hover_color',
211 [
212 'label' => esc_html__( 'Date Hover Color', 'easy-hotel' ),
213 'type' => Controls_Manager::COLOR,
214 'selectors' => [
215 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker td.active:hover' => 'color: {{VALUE}} !important;',
216 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker td:hover' => 'color: {{VALUE}} !important;',
217 ],
218 ]
219 );
220
221 $this->add_control(
222 'eshb_availability_calendar_table_date_booked_color',
223 [
224 'label' => esc_html__( 'Booked Date Color', 'easy-hotel' ),
225 'type' => Controls_Manager::COLOR,
226 'selectors' => [
227 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker td.booked-date' => 'color: {{VALUE}} !important;',
228 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker td.booked-date.active' => 'color: {{VALUE}} !important;',
229 ],
230 ]
231 );
232
233 $this->add_control(
234 'eshb_availability_calendar_table_date_hover_bg_color',
235 [
236 'label' => esc_html__( 'Date Active/Hover Background Color', 'easy-hotel' ),
237 'type' => Controls_Manager::COLOR,
238 'selectors' => [
239 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker td.active' => 'background-color: {{VALUE}} !important;',
240 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker td.active:hover' => 'background-color: {{VALUE}} !important;',
241 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker td:hover' => 'background-color: {{VALUE}} !important;',
242 ],
243 ]
244 );
245
246 $this->add_control(
247 'eshb_availability_calendar_apply_button_styles',
248 [
249 'type' => Controls_Manager::HEADING,
250 'label' => esc_html__( 'Apply Button', 'easy-hotel' ),
251 'separator' => 'before',
252 ]
253 );
254 $this->add_control(
255 'eshb_availability_calendar_apply_button_color',
256 [
257 'label' => esc_html__( 'Color', 'easy-hotel' ),
258 'type' => Controls_Manager::COLOR,
259 'selectors' => [
260 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker .range_inputs button.applyBtn' => 'color: {{VALUE}};',
261 ],
262 ]
263 );
264 $this->add_control(
265 'eshb_availability_calendar_apply_button_hover_color',
266 [
267 'label' => esc_html__( 'Hover Color', 'easy-hotel' ),
268 'type' => Controls_Manager::COLOR,
269 'selectors' => [
270 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker .range_inputs button.applyBtn:hover' => 'color: {{VALUE}};',
271 ],
272 ]
273 );
274 $this->add_control(
275 'eshb_availability_calendar_apply_button_bg_color',
276 [
277 'label' => esc_html__( 'Background Color', 'easy-hotel' ),
278 'type' => Controls_Manager::COLOR,
279 'selectors' => [
280 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker .range_inputs button.applyBtn' => 'background-color: {{VALUE}};',
281 ],
282 ]
283 );
284 $this->add_control(
285 'eshb_availability_calendar_apply_button_hover_bg_color',
286 [
287 'label' => esc_html__( 'Background Hover Color', 'easy-hotel' ),
288 'type' => Controls_Manager::COLOR,
289 'selectors' => [
290 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker .range_inputs button.applyBtn:hover' => 'background-color: {{VALUE}};',
291 ],
292 ]
293 );
294 $this->add_control(
295 'eshb_availability_calendar_apply_button_border_color',
296 [
297 'label' => esc_html__( 'Border Color', 'easy-hotel' ),
298 'type' => Controls_Manager::COLOR,
299 'selectors' => [
300 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker .range_inputs button.applyBtn' => 'border-color: {{VALUE}};',
301 ],
302 ]
303 );
304 $this->add_control(
305 'eshb_availability_calendar_apply_button_hover_border_color',
306 [
307 'label' => esc_html__( 'Border Hover Color', 'easy-hotel' ),
308 'type' => Controls_Manager::COLOR,
309 'selectors' => [
310 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker .range_inputs button.applyBtn:hover' => 'border-color: {{VALUE}};',
311 ],
312 ]
313 );
314
315 $this->add_control(
316 'eshb_availability_calendar_cancel_button_styles',
317 [
318 'type' => Controls_Manager::HEADING,
319 'label' => esc_html__( 'Cancel Button', 'easy-hotel' ),
320 'separator' => 'before',
321 ]
322 );
323 $this->add_control(
324 'eshb_availability_calendar_cancel_button_color',
325 [
326 'label' => esc_html__( 'Color', 'easy-hotel' ),
327 'type' => Controls_Manager::COLOR,
328 'selectors' => [
329 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker .range_inputs button.cancelBtn' => 'color: {{VALUE}};',
330 ],
331 ]
332 );
333 $this->add_control(
334 'eshb_availability_calendar_cancel_button_hover_color',
335 [
336 'label' => esc_html__( 'Hover Color', 'easy-hotel' ),
337 'type' => Controls_Manager::COLOR,
338 'selectors' => [
339 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker .range_inputs button.cancelBtn:hover' => 'color: {{VALUE}};',
340 ],
341 ]
342 );
343 $this->add_control(
344 'eshb_availability_calendar_cancel_button_bg_color',
345 [
346 'label' => esc_html__( 'Background Color', 'easy-hotel' ),
347 'type' => Controls_Manager::COLOR,
348 'selectors' => [
349 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker .range_inputs button.cancelBtn' => 'background-color: {{VALUE}};',
350 ],
351 ]
352 );
353 $this->add_control(
354 'eshb_availability_calendar_cancel_button_hover_bg_color',
355 [
356 'label' => esc_html__( 'Background Hover Color', 'easy-hotel' ),
357 'type' => Controls_Manager::COLOR,
358 'selectors' => [
359 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker .range_inputs button.cancelBtn:hover' => 'background-color: {{VALUE}};',
360 ],
361 ]
362 );
363 $this->add_control(
364 'eshb_availability_calendar_cancel_button_border_color',
365 [
366 'label' => esc_html__( 'Border Color', 'easy-hotel' ),
367 'type' => Controls_Manager::COLOR,
368 'selectors' => [
369 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker .range_inputs button.cancelBtn' => 'border-color: {{VALUE}};',
370 ],
371 ]
372 );
373 $this->add_control(
374 'eshb_availability_calendar_cancel_button_hover_border_color',
375 [
376 'label' => esc_html__( 'Border Hover Color', 'easy-hotel' ),
377 'type' => Controls_Manager::COLOR,
378 'selectors' => [
379 '{{WRAPPER}} .eshb-availability-calendars-area .eshb-availability-calendars .daterangepicker .range_inputs button.cancelBtn:hover' => 'border-color: {{VALUE}};',
380 ],
381 ]
382 );
383
384 $this->end_controls_section();
385
386 }
387
388 protected function render() {
389 $settings = $this->get_settings_for_display();
390 echo do_shortcode( '[eshb_availability_calendar]' );
391 }
392 }
393