From d6a86bf1dab0ec27adad372ecb828e21a77d3966 Mon Sep 17 00:00:00 2001 From: Herman van Rink Date: Sun, 28 May 2023 22:47:37 +0200 Subject: [PATCH] Only display a dashlet table if there is content for it, #6512 --- interface/web/dashboard/dashlets/databasequota.php | 9 +++++---- interface/web/dashboard/dashlets/mailquota.php | 9 +++++---- interface/web/dashboard/dashlets/quota.php | 9 ++++----- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/interface/web/dashboard/dashlets/databasequota.php b/interface/web/dashboard/dashlets/databasequota.php index 077a7ddbcb..5bb38be854 100644 --- a/interface/web/dashboard/dashlets/databasequota.php +++ b/interface/web/dashboard/dashlets/databasequota.php @@ -41,11 +41,12 @@ class dashlet_databasequota { $databases = $app->functions->htmlentities($databases); $tpl->setloop('databasequota', $databases); $has_databasequota = isset($databases[0]['used']); + + $tpl->setVar('has_databasequota', $has_databasequota); + $tpl->setVar('total_used', $app->functions->formatBytes($total_used, 0)); + + return $tpl->grab(); } - $tpl->setVar('has_databasequota', $has_databasequota); - $tpl->setVar('total_used', $app->functions->formatBytes($total_used, 0)); - - return $tpl->grab(); } } diff --git a/interface/web/dashboard/dashlets/mailquota.php b/interface/web/dashboard/dashlets/mailquota.php index 8b328ab6f9..f097005d7f 100644 --- a/interface/web/dashboard/dashlets/mailquota.php +++ b/interface/web/dashboard/dashlets/mailquota.php @@ -37,11 +37,12 @@ class dashlet_mailquota { //$emails = $app->functions->htmlentities($emails); $tpl->setloop('mailquota', $emails); $has_mailquota = isset($emails[0]['used']); - } - $tpl->setVar('has_mailquota', $has_mailquota); - $tpl->setVar('total_used', $app->functions->formatBytes($total_used, 0)); - return $tpl->grab(); + $tpl->setVar('has_mailquota', $has_mailquota); + $tpl->setVar('total_used', $app->functions->formatBytes($total_used, 0)); + + return $tpl->grab(); + } } } diff --git a/interface/web/dashboard/dashlets/quota.php b/interface/web/dashboard/dashlets/quota.php index adedbcf5c9..a70a1bf253 100644 --- a/interface/web/dashboard/dashlets/quota.php +++ b/interface/web/dashboard/dashlets/quota.php @@ -45,13 +45,12 @@ class dashlet_quota { $sites = $app->functions->htmlentities($sites); $tpl->setloop('quota', $sites); $has_quota = isset($sites[0]['used']); - } - $tpl->setVar('has_quota', $has_quota); - $tpl->setVar('total_used', $app->functions->formatBytes($total_used, 0)); - - return $tpl->grab(); + $tpl->setVar('has_quota', $has_quota); + $tpl->setVar('total_used', $app->functions->formatBytes($total_used, 0)); + return $tpl->grab(); + } } } -- GitLab