Skip to content

Commit

Permalink
respect custom-theme variants in UI::getTheme(); add margin to custom…
Browse files Browse the repository at this point in the history
…er-services dashboard-badges

Signed-off-by: Michael Kaufmann <[email protected]>
  • Loading branch information
d00p committed Nov 26, 2023
1 parent 7e0073f commit 75cf44a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions lib/Froxlor/UI/Panel/UI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
8 changes: 4 additions & 4 deletions templates/Froxlor/user/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,16 @@
<div class="ms-2 me-auto">
<div class="fw-bold">{{ lng('customer.services') }}</div>
{% if userinfo.imap == 1 %}
<span class="badge bg-success">IMAP</span>
<span class="badge bg-success me-1">IMAP</span>
{% endif %}
{% if userinfo.pop3 == 1 %}
<span class="badge bg-success">POP3</span>
<span class="badge bg-success me-1">POP3</span>
{% endif %}
{% if userinfo.phpenabled == 1 %}
<span class="badge bg-success">PHP</span>
<span class="badge bg-success me-1">PHP</span>
{% endif %}
{% if userinfo.perlenabled == 1 %}
<span class="badge bg-success">Perl/CGI</span>
<span class="badge bg-success me-1">Perl/CGI</span>
{% endif %}
{% if userinfo.api_allowed == 1 %}
<a href="{{ linker({'section':'index','page':'apikeys'}) }}">
Expand Down

0 comments on commit 75cf44a

Please sign in to comment.