-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule.php
37 lines (35 loc) · 1.9 KB
/
module.php
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
<?php
use NamelessMC\Framework\Extend;
return [
(new Extend\Language(__DIR__ . '/language')),
// TODO could these be more generic? with `registerFrontend` and `registerPanel`?
(new Extend\FrontendPages)
// TODO allow registerPageRepository to make page registration class-based if needed.
// IE: forms module is dynamically registering pages
// TODO, don't require defining page name here and in the class
->register('/members', 'members', 'members/members', \NamelessMC\Members\Pages\Members::class, false),
(new Extend\PanelPages)
// TODO, don't require defining page permission and name here and in the class
->register('/members/settings', 'members_settings', 'members/member_list_settings', \NamelessMC\Members\Pages\Panel\Settings::class, 'admincp.members', 'fas fa-cogs')
->register('/members', 'member_lists', 'members/member_lists', \NamelessMC\Members\Pages\Panel\Index::class, 'admincp.members', 'fas fa-users'),
(new Extend\Queries)
->register('/members/member_list', \NamelessMC\Members\Queries\MemberList::class),
(new Extend\Permissions)
->register([
'staffcp' => [
'admincp.members' => 'members/member_lists',
],
]),
(new Extend\DebugInfo)
->provide(\NamelessMC\Members\DebugInfo\Provider::class),
(new Extend\Events)
->listen(\UserRegisteredEvent::class, \NamelessMC\Members\Listeners\UserRegisteredListener::class),
(new Extend\Container)
->singleton(\NamelessMC\Members\MemberListManager::class),
(new Extend\ModuleLifecycle)
->onInstall(\NamelessMC\Members\Lifecycle\Install::class)
->onEnable(\NamelessMC\Members\Lifecycle\Enable::class)
->onDisable(\NamelessMC\Members\Lifecycle\Disable::class),
// TODO: assets? see if anything in AssetTree can be extracted here
// TODO: api endpoints & transformers
];