summaryrefslogtreecommitdiffstats
path: root/library/Director/Dashboard/Dashlet/ChoicesDashlet.php
blob: 105ebb9326c946d39a17649bc796fd8f303606a0 (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
34
35
36
37
38
39
40
41
42
43
<?php

namespace Icinga\Module\Director\Dashboard\Dashlet;

use Icinga\Module\Director\Auth\Permission;

abstract class ChoicesDashlet extends Dashlet
{
    protected $icon = 'flapping';

    public function getTitle()
    {
        return $this->translate('Choices');
    }

    public function getSummary()
    {
        return $this->translate(
            'Combine multiple templates into meaningful Choices, making life'
            . ' easier for your users'
        );
    }

    protected function getType()
    {
        return strtolower(substr(
            substr(get_called_class(), strlen(__NAMESPACE__) + 1),
            0,
            - strlen('ChoicesDashlet')
        ));
    }

    public function getUrl()
    {

        return 'director/templatechoices/' . $this->getType();
    }

    public function listRequiredPermissions()
    {
        return [Permission::ADMIN];
    }
}