-
Notifications
You must be signed in to change notification settings - Fork 1
/
extend.php
34 lines (26 loc) · 1.29 KB
/
extend.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
<?php
namespace Nearata\RelatedDiscussions;
use Flarum\Discussion\Filter\DiscussionFilterer;
use Flarum\Extend;
use Nearata\RelatedDiscussions\Discussion\Filter\RelatedDiscussionsFilter;
use Nearata\RelatedDiscussions\Listener\SettingsSavingListener;
return [
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/less/forum.less'),
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js'),
new Extend\Locales(__DIR__.'/locale'),
(new Extend\Filter(DiscussionFilterer::class))
->addFilter(RelatedDiscussionsFilter::class),
(new Extend\Settings)
->default('nearata-related-discussions.allow-guests', false)
->default('nearata-related-discussions.generator', 'random')
->default('nearata-related-discussions.max-discussions', 5)
->default('nearata-related-discussions.position', 'first_post')
->default('nearata-related-discussions.cache', '0d0h0m')
->serializeToForum('nearataRelatedDiscussionsAllowGuests', 'nearata-related-discussions.allow-guests', 'boolval')
->serializeToForum('nearataRelatedDiscussionsPosition', 'nearata-related-discussions.position'),
(new Extend\Event)
->listen(\Flarum\Settings\Event\Saving::class, SettingsSavingListener::class),
];