1<?php
2/* Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */
3
4class Zend_View_Helper_HostFlags extends Zend_View_Helper_Abstract
5{
6    public function hostFlags($host)
7    {
8        $icons = array();
9        if (! $host->host_handled && $host->host_state > 0) {
10            $icons[] = $this->view->icon('attention-alt', $this->view->translate('Unhandled'));
11        }
12        if ($host->host_acknowledged) {
13            $icons[] = $this->view->icon('ok', $this->view->translate('Acknowledged'));
14        }
15        if ($host->host_is_flapping) {
16            $icons[] = $this->view->icon('flapping', $this->view->translate('Flapping'));
17        }
18        if (! $host->host_notifications_enabled) {
19            $icons[] = $this->view->icon('bell-off-empty', $this->view->translate('Notifications Disabled'));
20        }
21        if ($host->host_in_downtime) {
22            $icons[] = $this->view->icon('plug', $this->view->translate('In Downtime'));
23        }
24        if (! $host->host_active_checks_enabled) {
25            if (! $host->host_passive_checks_enabled) {
26                $icons[] = $this->view->icon('eye-off', $this->view->translate('Active And Passive Checks Disabled'));
27            } else {
28                $icons[] = $this->view->icon('eye-off', $this->view->translate('Active Checks Disabled'));
29            }
30        }
31        return implode(' ', $icons);
32    }
33}
34