Skip to content

Commit

Permalink
The theme variable can be changed by the "theme" query parameter for …
Browse files Browse the repository at this point in the history
…the booking page (#1205)
  • Loading branch information
alextselegidis committed May 27, 2022
1 parent d82f95f commit 12df842
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions application/controllers/Booking.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ public function index()
$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();
Expand Down Expand Up @@ -223,6 +229,7 @@ public function index()
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,
Expand Down
2 changes: 1 addition & 1 deletion application/views/layouts/booking_layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/vendor/jquery-ui-dist/jquery-ui.min.css') ?>">
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/vendor/cookieconsent/cookieconsent.min.css') ?>">
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/css/themes/' . setting('theme', 'default') . '.css') ?>">
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/css/themes/' . vars('theme') . '.css') ?>">
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/css/general.css') ?>">
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/css/layouts/booking_layout.css') ?>">

Expand Down

0 comments on commit 12df842

Please sign in to comment.