summaryrefslogtreecommitdiffstats
path: root/library/Icingadb/Widget/ItemList/ServiceList.php
blob: 11febb0a57088405325386c9f27f542a853894ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php

/* Icinga DB Web | (c) 2020 Icinga GmbH | GPLv2 */

namespace Icinga\Module\Icingadb\Widget\ItemList;

use Icinga\Module\Icingadb\Common\Links;
use ipl\Web\Url;

class ServiceList extends StateList
{
    protected $defaultAttributes = ['class' => 'service-list'];

    protected function getItemClass(): string
    {
        switch ($this->getViewMode()) {
            case 'minimal':
                return ServiceListItemMinimal::class;
            case 'detailed':
                return ServiceListItemDetailed::class;
            case 'objectHeader':
                return ServiceDetailHeader::class;
            default:
                return ServiceListItem::class;
        }
    }

    protected function init()
    {
        $this->setMultiselectUrl(Links::servicesDetails());
        $this->setDetailUrl(Url::fromPath('icingadb/service'));
    }
}