-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.php
More file actions
118 lines (110 loc) · 4.46 KB
/
Copy pathPlugin.php
File metadata and controls
118 lines (110 loc) · 4.46 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php namespace JumpLink\Events;
use Backend;
use System\Classes\PluginBase;
use JumpLink\Events\Models\Booking;
/**
* JumpLink Events Plugin
*
* Lokale Ablösung der clientseitigen Firebase/Firestore-Lösung für Führungen:
* Kalender, Events (mit Staffelpreisen & Bildergalerien) und Buchungen.
*/
class Plugin extends PluginBase
{
public function pluginDetails()
{
return [
'name' => 'jumplink.events::lang.plugin.name',
'description' => 'jumplink.events::lang.plugin.description',
'author' => 'JumpLink – Art+Code Studio',
'icon' => 'icon-compass',
'homepage' => 'https://artandcode.studio',
];
}
public function registerComponents()
{
// Serverseitige Darstellung (SEO) – ergänzt die clientseitige JSON-API
// aus routes.php. Das Plugin unterstützt damit beide Render-Modi; die
// Buchung läuft über den gemeinsamen BookingService (Api::book für JSON,
// EventList::onBook für serverseitiges Winter-AJAX).
return [
\JumpLink\Events\Components\EventList::class => 'eventList',
// Optionaler Frontend-Inline-Editor (nur aktiv mit Samuell.ContentEditor).
\JumpLink\Events\Components\EventInlineEditor::class => 'eventInlineEditor',
];
}
public function registerNavigation()
{
return [
'events' => [
'label' => 'jumplink.events::lang.plugin.menu_label',
'url' => Backend::url('jumplink/events/events'),
'icon' => 'icon-compass',
'permissions' => ['jumplink.events.*'],
'order' => 500,
'sideMenu' => [
'events' => [
'label' => 'jumplink.events::lang.events.menu_label',
'icon' => 'icon-map-signs',
'url' => Backend::url('jumplink/events/events'),
'permissions' => ['jumplink.events.manage_events'],
],
'calendars' => [
'label' => 'jumplink.events::lang.calendars.menu_label',
'icon' => 'icon-calendar',
'url' => Backend::url('jumplink/events/calendars'),
'permissions' => ['jumplink.events.manage_events'],
],
'bookings' => [
'label' => 'jumplink.events::lang.bookings.menu_label',
'icon' => 'icon-envelope',
'url' => Backend::url('jumplink/events/bookings'),
'permissions' => ['jumplink.events.manage_bookings'],
'counter' => [Booking::class, 'unconfirmedCount'],
'counterLabel' => 'jumplink.events::lang.bookings.counter_label',
],
],
],
];
}
public function registerPermissions()
{
return [
'jumplink.events.manage_events' => [
'tab' => 'jumplink.events::lang.plugin.menu_label',
'label' => 'jumplink.events::lang.permissions.manage_events',
],
'jumplink.events.manage_bookings' => [
'tab' => 'jumplink.events::lang.plugin.menu_label',
'label' => 'jumplink.events::lang.permissions.manage_bookings',
],
];
}
public function registerSettings()
{
return [
'settings' => [
'label' => 'jumplink.events::lang.settings.label',
'description' => 'jumplink.events::lang.settings.description',
'category' => 'jumplink.events::lang.plugin.menu_label',
'icon' => 'icon-cog',
'class' => \JumpLink\Events\Models\Settings::class,
'permissions' => ['jumplink.events.manage_events'],
'order' => 500,
],
];
}
public function registerMailTemplates()
{
return [
'jumplink.events::mail.booking_notification',
'jumplink.events::mail.booking_confirmation',
];
}
public function register()
{
$this->registerConsoleCommand(
'jumplink.events.import',
\JumpLink\Events\Console\ImportFirestore::class
);
}
}