PluginProbe
Appointment Booking Plugin – LatePoint | Calendar & Scheduling for WordPress / 5.2.8
Appointment Booking Plugin – LatePoint | Calendar & Scheduling for WordPress v5.2.8
5.6.11 5.6.10 5.6.9 5.6.8 5.6.7 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 All 48 releases
latepoint / lib / controllers / events_controller.php
events_controller.php
49 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * Copyright (c) 2024 LatePoint LLC. All rights reserved.
4 */
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly.
8 }
9
10
11 if ( ! class_exists( 'OsEventsController' ) ) :
12
13
14 class OsEventsController extends OsController {
15
16 private $booking;
17
18 function __construct(){
19 parent::__construct();
20
21 $this->action_access['public'] = array_merge($this->action_access['public'], ['load_calendar_events', 'events_day_view']);
22 $this->views_folder = LATEPOINT_VIEWS_ABSPATH . 'events/';
23 }
24
25 public function load_calendar_events() {
26
27 $target_date = new OsWpDateTime( $this->params['target_date_string'] );
28 $this->vars['target_date'] = $target_date;
29
30 $this->vars['filter'] = $this->params['filter'] ?? [];
31 $this->vars['range_type'] = $this->params['calendar_range_type'] ?? 'month';
32 $this->vars['restrictions'] = $this->params['restrictions'] ? json_decode( $this->params['restrictions'], true ) : [];
33
34 $this->set_layout( 'none' );
35 $this->format_render( __FUNCTION__ );
36 }
37
38 public function events_day_view(){
39 $target_date = new OsWpDateTime($this->params['target_date_string']);
40
41 $this->vars['target_date'] = $target_date;
42 $this->vars['filter'] = $this->params['filter'] ?? [];
43
44 $this->set_layout('none');
45 $this->format_render(__FUNCTION__);
46 }
47 }
48
49 endif;