From 1ac4a2050c8076eb96e07e83721ebc9db864db94 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:47:21 +0200 Subject: Adding upstream version 0.3.3. Signed-off-by: Daniel Baumann --- application/views/helpers/Badges.php | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 application/views/helpers/Badges.php (limited to 'application/views/helpers/Badges.php') diff --git a/application/views/helpers/Badges.php b/application/views/helpers/Badges.php new file mode 100644 index 0000000..6066a72 --- /dev/null +++ b/application/views/helpers/Badges.php @@ -0,0 +1,49 @@ +'; + foreach ($status->getProperties() as $key => $value) { + if ($problemsOnly === true && ($key === 'ok' || $key === 'downtime_active') + || ($key === 'total' && $showTotal !== true) + ) { + continue; + } + if ($value !== null && $value > 0) { + $values = true; + $title = $value . ' ' . $this->prettyTitle($key); + $class = 'tlv-status-tile ' . str_replace('_', ' ', $key); + $htm .= sprintf( + '
%s
', + $class, + $title, + $value + ); + } + } + $htm .= ''; + + return $values ? $htm : ''; + } +} -- cgit v1.2.3