2015-09-11 09:23:06 -04:00
|
|
|
<?php
|
|
|
|
|
|
2016-11-23 05:13:29 -05:00
|
|
|
/**
|
2016-11-27 18:15:14 -05:00
|
|
|
* @deprecated
|
2016-11-23 05:13:29 -05:00
|
|
|
* @codingStandardsIgnoreStart
|
|
|
|
|
*/
|
2015-09-11 09:23:06 -04:00
|
|
|
class Zend_View_Helper_RenderStateBadges extends Zend_View_Helper_Abstract
|
|
|
|
|
{
|
2016-11-23 05:13:29 -05:00
|
|
|
// @codingStandardsIgnoreEnd
|
2015-09-11 09:23:06 -04:00
|
|
|
public function renderStateBadges($summary)
|
|
|
|
|
{
|
|
|
|
|
$html = '';
|
|
|
|
|
|
|
|
|
|
foreach ($summary as $state => $cnt) {
|
2016-11-23 05:13:29 -05:00
|
|
|
if ($cnt === 0
|
|
|
|
|
|| $state === 'OK'
|
2016-11-23 06:35:17 -05:00
|
|
|
|| $state === 'UP'
|
2016-11-23 05:13:29 -05:00
|
|
|
) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-06 16:33:59 -04:00
|
|
|
$html .= '<span class="badge badge-' . strtolower($state)
|
|
|
|
|
. '" title="' . mt('monitoring', $state) . '">'
|
2015-09-11 09:23:06 -04:00
|
|
|
. $cnt . '</span>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($html !== '') {
|
|
|
|
|
$html = '<div class="badges">' . $html . '</div>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $html;
|
|
|
|
|
}
|
|
|
|
|
}
|