From 2bf9a6193ec05d7d8550063553babf8a78654be7 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 24 Jan 2022 20:02:17 +0100 Subject: [PATCH] Add a new setting that toggles the login link of the booking page (#1148). --- application/controllers/Booking.php | 2 + .../language/arabic/translations_lang.php | 2 + .../language/bulgarian/translations_lang.php | 2 + .../language/catalan/translations_lang.php | 2 + .../language/chinese/translations_lang.php | 2 + .../language/czech/translations_lang.php | 2 + .../language/danish/translations_lang.php | 2 + .../language/dutch/translations_lang.php | 2 + .../language/english/translations_lang.php | 2 + .../language/finnish/translations_lang.php | 2 + .../language/french/translations_lang.php | 2 + .../language/greek/translations_lang.php | 2 + .../language/hebrew/translations_lang.php | 2 + .../language/hindi/translations_lang.php | 2 + .../language/hungarian/translations_lang.php | 2 + .../language/italian/translations_lang.php | 2 + .../language/japanese/translations_lang.php | 2 + .../luxembourgish/translations_lang.php | 2 + .../language/marathi/translations_lang.php | 2 + .../language/polish/translations_lang.php | 2 + .../portuguese-br/translations_lang.php | 2 + .../language/portuguese/translations_lang.php | 2 + .../language/romanian/translations_lang.php | 2 + .../language/russian/translations_lang.php | 2 + .../language/slovak/translations_lang.php | 2 + .../language/spanish/translations_lang.php | 2 + .../language/swedish/translations_lang.php | 2 + .../language/turkish/translations_lang.php | 2 + .../034_add_display_login_button_setting.php | 41 +++++++++++++++++++ .../views/components/booking_footer.php | 19 +++++++-- application/views/layouts/booking_layout.php | 4 +- application/views/pages/booking_settings.php | 17 ++++++++ 32 files changed, 131 insertions(+), 6 deletions(-) create mode 100644 application/migrations/034_add_display_login_button_setting.php diff --git a/application/controllers/Booking.php b/application/controllers/Booking.php index e0547751..1822a434 100755 --- a/application/controllers/Booking.php +++ b/application/controllers/Booking.php @@ -128,6 +128,7 @@ class Booking extends EA_Controller { $display_privacy_policy = setting('display_privacy_policy'); $privacy_policy_content = setting('privacy_policy_content'); $display_any_provider = setting('display_any_provider'); + $display_login_button = setting('display_login_button'); $display_delete_personal_information = setting('display_delete_personal_information'); $book_advance_timeout = setting('book_advance_timeout'); @@ -250,6 +251,7 @@ class Booking extends EA_Controller { 'display_privacy_policy' => $display_privacy_policy, 'privacy_policy_content' => $privacy_policy_content, 'display_any_provider' => $display_any_provider, + 'display_login_button' => $display_login_button, 'display_delete_personal_information' => $display_delete_personal_information, 'google_analytics_code' => $google_analytics_code, 'matomo_analytics_url' => $matomo_analytics_url, diff --git a/application/language/arabic/translations_lang.php b/application/language/arabic/translations_lang.php index 78ddb41d..e3ab44cb 100755 --- a/application/language/arabic/translations_lang.php +++ b/application/language/arabic/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/bulgarian/translations_lang.php b/application/language/bulgarian/translations_lang.php index ee7b35b9..9b7360c6 100755 --- a/application/language/bulgarian/translations_lang.php +++ b/application/language/bulgarian/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/catalan/translations_lang.php b/application/language/catalan/translations_lang.php index 484bdf28..0a119841 100644 --- a/application/language/catalan/translations_lang.php +++ b/application/language/catalan/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/chinese/translations_lang.php b/application/language/chinese/translations_lang.php index f32a6cbd..b0805074 100755 --- a/application/language/chinese/translations_lang.php +++ b/application/language/chinese/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/czech/translations_lang.php b/application/language/czech/translations_lang.php index 240ef2c4..58717efd 100644 --- a/application/language/czech/translations_lang.php +++ b/application/language/czech/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/danish/translations_lang.php b/application/language/danish/translations_lang.php index 6df23f9d..ef132482 100755 --- a/application/language/danish/translations_lang.php +++ b/application/language/danish/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/dutch/translations_lang.php b/application/language/dutch/translations_lang.php index a55a0ded..4723a106 100755 --- a/application/language/dutch/translations_lang.php +++ b/application/language/dutch/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/english/translations_lang.php b/application/language/english/translations_lang.php index 0a3489ae..ba93dc83 100755 --- a/application/language/english/translations_lang.php +++ b/application/language/english/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/finnish/translations_lang.php b/application/language/finnish/translations_lang.php index 999a1b0d..13b9284d 100755 --- a/application/language/finnish/translations_lang.php +++ b/application/language/finnish/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/french/translations_lang.php b/application/language/french/translations_lang.php index 1a469a7a..59b75d50 100755 --- a/application/language/french/translations_lang.php +++ b/application/language/french/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/greek/translations_lang.php b/application/language/greek/translations_lang.php index 54cfcac0..ebab792d 100755 --- a/application/language/greek/translations_lang.php +++ b/application/language/greek/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/hebrew/translations_lang.php b/application/language/hebrew/translations_lang.php index 693e985e..23fd83bc 100644 --- a/application/language/hebrew/translations_lang.php +++ b/application/language/hebrew/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/hindi/translations_lang.php b/application/language/hindi/translations_lang.php index fb991bd7..e6a74632 100755 --- a/application/language/hindi/translations_lang.php +++ b/application/language/hindi/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/hungarian/translations_lang.php b/application/language/hungarian/translations_lang.php index 28cabb4a..b64c95e4 100755 --- a/application/language/hungarian/translations_lang.php +++ b/application/language/hungarian/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/italian/translations_lang.php b/application/language/italian/translations_lang.php index 205cd484..f33aea92 100755 --- a/application/language/italian/translations_lang.php +++ b/application/language/italian/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/japanese/translations_lang.php b/application/language/japanese/translations_lang.php index 8d182642..0705974e 100755 --- a/application/language/japanese/translations_lang.php +++ b/application/language/japanese/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/luxembourgish/translations_lang.php b/application/language/luxembourgish/translations_lang.php index dd2a3b0e..8fdd5b74 100755 --- a/application/language/luxembourgish/translations_lang.php +++ b/application/language/luxembourgish/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/marathi/translations_lang.php b/application/language/marathi/translations_lang.php index ec756085..c11b9a49 100644 --- a/application/language/marathi/translations_lang.php +++ b/application/language/marathi/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/polish/translations_lang.php b/application/language/polish/translations_lang.php index 6f235e5e..ffcd1866 100755 --- a/application/language/polish/translations_lang.php +++ b/application/language/polish/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/portuguese-br/translations_lang.php b/application/language/portuguese-br/translations_lang.php index 9e7165ac..c4b618d6 100755 --- a/application/language/portuguese-br/translations_lang.php +++ b/application/language/portuguese-br/translations_lang.php @@ -354,4 +354,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/portuguese/translations_lang.php b/application/language/portuguese/translations_lang.php index d48c61a7..4193c281 100755 --- a/application/language/portuguese/translations_lang.php +++ b/application/language/portuguese/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/romanian/translations_lang.php b/application/language/romanian/translations_lang.php index 80066651..3a2ef1ca 100755 --- a/application/language/romanian/translations_lang.php +++ b/application/language/romanian/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/russian/translations_lang.php b/application/language/russian/translations_lang.php index 35d232e5..f58a19c9 100755 --- a/application/language/russian/translations_lang.php +++ b/application/language/russian/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/slovak/translations_lang.php b/application/language/slovak/translations_lang.php index 1803e402..cc0f07af 100755 --- a/application/language/slovak/translations_lang.php +++ b/application/language/slovak/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/spanish/translations_lang.php b/application/language/spanish/translations_lang.php index 70f0dc14..79c2e315 100755 --- a/application/language/spanish/translations_lang.php +++ b/application/language/spanish/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/swedish/translations_lang.php b/application/language/swedish/translations_lang.php index 8f90ca03..613fef62 100644 --- a/application/language/swedish/translations_lang.php +++ b/application/language/swedish/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/language/turkish/translations_lang.php b/application/language/turkish/translations_lang.php index 570fa12c..c3b27a43 100755 --- a/application/language/turkish/translations_lang.php +++ b/application/language/turkish/translations_lang.php @@ -355,4 +355,6 @@ $lang['localization'] = 'Localization'; $lang['integrations'] = 'Integrations'; $lang['company'] = 'Company'; $lang['remove'] = 'Remove'; +$lang['login_button'] = 'Login Button'; +$lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; // End diff --git a/application/migrations/034_add_display_login_button_setting.php b/application/migrations/034_add_display_login_button_setting.php new file mode 100644 index 00000000..90aaded8 --- /dev/null +++ b/application/migrations/034_add_display_login_button_setting.php @@ -0,0 +1,41 @@ + + * @copyright Copyright (c) Alex Tselegidis + * @license https://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link https://easyappointments.org + * @since v1.4.0 + * ---------------------------------------------------------------------------- */ + +class Migration_Add_display_login_button_setting extends EA_Migration { + /** + * Upgrade method. + */ + public function up() + { + if ( ! $this->db->get_where('settings', ['name' => 'display_login_button'])->num_rows()) + { + $this->db->insert('settings', [ + 'name' => 'display_login_button', + 'value' => '1' + ]); + } + } + + /** + * Downgrade method. + */ + public function down() + { + if ( ! $this->db->get_where('settings', ['name' => 'display_login_button'])->num_rows()) + { + $this->db->delete('settings', [ + 'name' => 'display_login_button', + ]); + } + } +} diff --git a/application/views/components/booking_footer.php b/application/views/components/booking_footer.php index db200a5a..ca47d49f 100644 --- a/application/views/components/booking_footer.php +++ b/application/views/components/booking_footer.php @@ -1,3 +1,11 @@ + + diff --git a/application/views/layouts/booking_layout.php b/application/views/layouts/booking_layout.php index bd554430..45806b1d 100644 --- a/application/views/layouts/booking_layout.php +++ b/application/views/layouts/booking_layout.php @@ -25,13 +25,13 @@
-
+
vars('company_name'), 'company_logo' => vars('company_logo')]) ?> - + vars('display_login_button')]) ?>
diff --git a/application/views/pages/booking_settings.php b/application/views/pages/booking_settings.php index 9137fc8f..874dee90 100755 --- a/application/views/pages/booking_settings.php +++ b/application/views/pages/booking_settings.php @@ -271,6 +271,22 @@
+
+
+ + +
+ +
+ + + +
+
+
+