Completed
Push — master ( cb5fa1...8201f5 )
by Vojta
06:45
created

Plugin   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 81
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 81
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
B registerNavigation() 0 35 1
A registerComponents() 0 6 1
A registerReportWidgets() 0 9 1
A registerMailTemplates() 0 7 1
A registerSettings() 0 12 1
1
<?php namespace VojtaSvoboda\Reservations;
2
3
use Backend;
4
use System\Classes\PluginBase;
5
6
class Plugin extends PluginBase
7
{
8
    public function boot()
9
    {
10
        $this->app->bind('vojtasvoboda.reservations.facade', 'VojtaSvoboda\Reservations\Facades\ReservationsFacade');
11
    }
12
13
    public function registerNavigation()
14
    {
15
        return [
16
            'reservations' => [
17
                'label'       => 'vojtasvoboda.reservations::lang.plugin.menu_label',
18
                'url'         => Backend::url('vojtasvoboda/reservations/reservations'),
19
                'icon'        => 'icon-calendar-o',
20
                'permissions' => ['vojtasvoboda.reservations.*'],
21
                'order'       => 500,
22
                'sideMenu' => [
23
                    'reservations' => [
24
                        'label'       => 'vojtasvoboda.reservations::lang.reservations.menu_label',
25
                        'url'         => Backend::url('vojtasvoboda/reservations/reservations'),
26
                        'icon'        => 'icon-calendar-o',
27
                        'permissions' => ['vojtasvoboda.reservations.reservations'],
28
                        'order'       => 100,
29
                    ],
30
                    'statuses' => [
31
                        'label'       => 'vojtasvoboda.reservations::lang.statuses.menu_label',
32
                        'icon'        => 'icon-star',
33
                        'url'         => Backend::url('vojtasvoboda/reservations/statuses'),
34
                        'permissions' => ['vojtasvoboda.reservations.statuses'],
35
                        'order'       => 200,
36
                    ],
37
                    'export' => [
38
                        'label'       => 'vojtasvoboda.reservations::lang.export.menu_label',
39
                        'icon'        => 'icon-sign-out',
40
                        'url'         => Backend::url('vojtasvoboda/reservations/reservations/export'),
41
                        'permissions' => ['vojtasvoboda.reservations.export'],
42
                        'order'       => 300,
43
                    ],
44
                ],
45
            ],
46
        ];
47
    }
48
49
    public function registerComponents()
50
    {
51
        return [
52
            'VojtaSvoboda\Reservations\Components\ReservationForm' => 'reservationForm',
53
        ];
54
    }
55
56
    public function registerReportWidgets()
57
    {
58
        return [
59
            'VojtaSvoboda\Reservations\ReportWidgets\Reservations' => [
60
                'label'   => 'vojtasvoboda.reservations::lang.reservations.widget_label',
61
                'context' => 'dashboard',
62
            ],
63
        ];
64
    }
65
66
    public function registerMailTemplates()
67
    {
68
        return [
69
            'vojtasvoboda.reservations::mail.reservation-cs' => 'Reservation confirmation CS',
70
            'vojtasvoboda.reservations::mail.reservation-en' => 'Reservation confirmation EN',
71
        ];
72
    }
73
74
    public function registerSettings()
75
    {
76
        return [
77
            'settings' => [
78
                'label' => 'Reservations',
79
                'description' => 'Manage Reservations settings.',
80
                'icon' => 'icon-calendar-o',
81
                'class' => 'VojtaSvoboda\Reservations\Models\Settings',
82
                'order' => 100,
83
            ],
84
        ];
85
    }
86
}
87