mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-27 01:39:35 -05:00
24 lines
653 B
PHP
24 lines
653 B
PHP
<?php
|
|
|
|
class Zend_View_Helper_RenderStateBadges extends Zend_View_Helper_Abstract
|
|
{
|
|
public function renderStateBadges($summary)
|
|
{
|
|
$html = '';
|
|
|
|
foreach ($summary as $state => $cnt) {
|
|
if ($cnt === 0) continue;
|
|
if ($state === 'OK') continue;
|
|
if ($state === 'UP') continue;
|
|
$html .= '<span class="badge badge-' . strtolower($state)
|
|
. '" title="' . mt('monitoring', $state) . '">'
|
|
. $cnt . '</span>';
|
|
}
|
|
|
|
if ($html !== '') {
|
|
$html = '<div class="badges">' . $html . '</div>';
|
|
}
|
|
|
|
return $html;
|
|
}
|
|
}
|