-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
extend.php
33 lines (24 loc) · 1.22 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
<?php
namespace Dem13n\Discussion\Cards;
use Flarum\Extend;
use Flarum\Api\Controller\ListDiscussionsController;
use Dem13n\Discussion\Cards\Api\Controllers\UploadImageController;
use Dem13n\Discussion\Cards\Api\Controllers\DeleteImageController;
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')
->css(__DIR__ . '/less/admin.less'),
(new Extend\Locales(__DIR__ . '/locale')),
(new Extend\ApiController(ListDiscussionsController::class))
->addInclude(['firstPost', 'posts', 'posts.user']),
new Extenders\RegisterLessVariables(),
(new Extend\Settings())
->serializeToForum('dem13nDiscussionCards', 'dem13n_discussion_cards')
->serializeToForum('dem13nDiscussionCardsDefaultImage', 'dem13n_discussion_cards_default_image_path'),
(new Extend\Routes('api'))
->post('/dem13n_discussion_cards_default_image', 'dem13n_discussion_cards_default_image', UploadImageController::class)
->delete('/dem13n_discussion_cards_default_image', 'dem13n_discussion_cards_default_image.delete', DeleteImageController::class)
];