This repository has been archived by the owner on Aug 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextend.php
42 lines (37 loc) · 1.42 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
35
36
37
38
39
40
41
42
<?php
/**
* Edit Histories Extension for Flarum.
*
* LICENSE: For the full copyright and license information,
* please view the LICENSE.md file that was distributed
* with this source code.
*
* @package the-turk/flarum-edit-histories
* @author Hasan Özbey <hasanoozbey@gmail.com>
* @copyright 2020
* @license The MIT License
* @version Release: 0.1.5
* @link https://github.com/the-turk/flarum-edit-notifications
*/
namespace TheTurk\EditNotifications;
use Flarum\Extend;
use Flarum\Api\Serializer\PostSerializer;
use TheTurk\EditNotifications\Notification\PostEditedBlueprint;
use TheTurk\EditNotifications\Notification\InteractedPostEditedBlueprint;
use Illuminate\Contracts\Events\Dispatcher;
use Flarum\Event\ConfigureNotificationTypes;
use TheTurk\EditNotifications\Listeners\SubscribeToEvents;
return [
(new Extend\Frontend('admin'))
->js(__DIR__ . '/js/dist/admin.js'),
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js'),
(new Extend\Locales(__DIR__ . '/locale')),
function (Dispatcher $events) {
$events->listen(ConfigureNotificationTypes::class, function (ConfigureNotificationTypes $event) {
$event->add(PostEditedBlueprint::class, PostSerializer::class, ['alert']);
$event->add(InteractedPostEditedBlueprint::class, PostSerializer::class, ['alert']);
});
$events->subscribe(SubscribeToEvents::class);
},
];