activities_controller.php
1 month ago
auth_controller.php
3 months ago
booking_form_settings_controller.php
3 months ago
bookings_controller.php
14 hours ago
calendars_controller.php
3 months ago
carts_controller.php
14 hours ago
controller.php
3 months ago
customer_cabinet_controller.php
2 months ago
customers_controller.php
14 hours ago
dashboard_controller.php
2 months ago
default_agent_controller.php
3 months ago
events_controller.php
3 months ago
form_fields_controller.php
1 week ago
integrations_controller.php
3 months ago
invoices_controller.php
14 hours ago
manage_booking_by_key_controller.php
3 months ago
manage_order_by_key_controller.php
3 months ago
notifications_controller.php
3 months ago
orders_controller.php
14 hours ago
pro_controller.php
2 weeks ago
process_jobs_controller.php
3 months ago
processes_controller.php
1 month ago
razorpay_connect_controller.php
1 week ago
search_controller.php
3 months ago
services_controller.php
3 months ago
settings_controller.php
2 months ago
steps_controller.php
2 weeks ago
stripe_connect_controller.php
1 week ago
support_topics_controller.php
3 months ago
todos_controller.php
3 months ago
transactions_controller.php
14 hours ago
wizard_controller.php
1 week ago
events_controller.php
50 lines
| 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; |
| 50 |