From 12df8420cb113a37e3b20cd170c763f3e0966ab0 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Fri, 27 May 2022 10:04:40 +0200 Subject: [PATCH] The theme variable can be changed by the "theme" query parameter for the booking page (#1205) --- application/controllers/Booking.php | 7 +++++++ application/views/layouts/booking_layout.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/application/controllers/Booking.php b/application/controllers/Booking.php index 87e764f4..185fa15d 100755 --- a/application/controllers/Booking.php +++ b/application/controllers/Booking.php @@ -132,6 +132,12 @@ class Booking extends EA_Controller { $display_login_button = setting('display_login_button'); $display_delete_personal_information = setting('display_delete_personal_information'); $book_advance_timeout = setting('book_advance_timeout'); + $theme = request('theme', setting('theme', 'default')); + + if (empty($theme) || ! file_exists(__DIR__ . '/../../assets/css/themes/' . $theme . '.min.css')) + { + $theme = 'default'; + } $timezones = $this->timezones->to_array(); $grouped_timezones = $this->timezones->to_grouped_array(); @@ -223,6 +229,7 @@ class Booking extends EA_Controller { html_vars([ 'available_services' => $available_services, 'available_providers' => $available_providers, + 'theme' => $theme, 'company_name' => $company_name, 'company_logo' => $company_logo, 'company_color' => $company_color === '#ffffff' ? '' : $company_color, diff --git a/application/views/layouts/booking_layout.php b/application/views/layouts/booking_layout.php index 86844128..db2a82d8 100644 --- a/application/views/layouts/booking_layout.php +++ b/application/views/layouts/booking_layout.php @@ -15,7 +15,7 @@ - +