From 75cf44a6d2523b4e6bef17000eabc202d0cdd072 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 26 Nov 2023 09:24:44 +0100 Subject: [PATCH] respect custom-theme variants in UI::getTheme(); add margin to customer-services dashboard-badges Signed-off-by: Michael Kaufmann --- lib/Froxlor/UI/Panel/UI.php | 4 ++++ lib/init.php | 2 +- templates/Froxlor/user/index.html.twig | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/Froxlor/UI/Panel/UI.php b/lib/Froxlor/UI/Panel/UI.php index ea0e648b10..3cec80f807 100644 --- a/lib/Froxlor/UI/Panel/UI.php +++ b/lib/Froxlor/UI/Panel/UI.php @@ -321,6 +321,10 @@ public static function getTheme() } } } + // check for template-variant + if (preg_match("/([a-z0-9.\-]+)_([a-z0-9.\-]+)/i", $theme, $matches)) { + $theme = $matches[1]; + } if (!file_exists(Froxlor::getInstallDir() . '/templates/' . $theme)) { PhpHelper::phpErrHandler(E_USER_WARNING, "Theme '" . $theme . "' could not be found.", __FILE__, __LINE__); $theme = self::$default_theme; diff --git a/lib/init.php b/lib/init.php index af28cf12f2..bad47945ac 100644 --- a/lib/init.php +++ b/lib/init.php @@ -188,7 +188,7 @@ // Check if a different variant of the theme is used $themevariant = "default"; -if (preg_match("/([a-z0-9\.\-]+)_([a-z0-9\.\-]+)/i", $theme, $matches)) { +if (preg_match("/([a-z0-9.\-]+)_([a-z0-9.\-]+)/i", $theme, $matches)) { $theme = $matches[1]; $themevariant = $matches[2]; } diff --git a/templates/Froxlor/user/index.html.twig b/templates/Froxlor/user/index.html.twig index 7a1aca42fa..b8672f8f62 100644 --- a/templates/Froxlor/user/index.html.twig +++ b/templates/Froxlor/user/index.html.twig @@ -174,16 +174,16 @@
{{ lng('customer.services') }}
{% if userinfo.imap == 1 %} - IMAP + IMAP {% endif %} {% if userinfo.pop3 == 1 %} - POP3 + POP3 {% endif %} {% if userinfo.phpenabled == 1 %} - PHP + PHP {% endif %} {% if userinfo.perlenabled == 1 %} - Perl/CGI + Perl/CGI {% endif %} {% if userinfo.api_allowed == 1 %}