This repository has been archived by the owner on Jul 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
extend.php
46 lines (42 loc) · 1.91 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
43
44
45
46
<?php
/**
* This file is part of reflar/gamification.
*
* Copyright (c) ReFlar.
*
* http://reflar.io
*
* For the full copyright and license information, please view the license.md
* file that was distributed with this source code.
*/
namespace Reflar\Gamification;
use Flarum\Extend;
use Illuminate\Contracts\Events\Dispatcher;
use Reflar\Gamification\Api\Controllers;
return [
(new Extend\Frontend('admin'))
->css(__DIR__ . '/resources/less/admin/extension.less')
->js(__DIR__.'/js/dist/admin.js'),
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__ . '/resources/less/forum/extension.less')
->route('/rankings', 'rankings')
->route('/hot', 'hot'),
new Extend\Locales(__DIR__ . '/resources/locale'),
(new Extend\Routes('api'))
->post('/reflar/gamification/convert', 'reflar.gamification.convert', Controllers\ConvertLikesController::class)
->get('/ranks', 'ranks.index', Controllers\ListRanksController::class)
->post('/ranks', 'ranks.create', Controllers\CreateRankController::class)
->post('/topimage{id}', 'reflar.topImage.add', Controllers\UploadTopImageController::class)
->delete('/topimage{id}', 'reflar.topImage.delete', Controllers\DeleteTopImageController::class)
->patch('/ranks/{id}', 'ranks.update', Controllers\UpdateRankController::class)
->delete('/ranks/{id}', 'ranks.delete', Controllers\DeleteRankController::class)
->get('/rankings', 'rankings', Controllers\OrderByPointsController::class),
function (Dispatcher $events) {
$events->subscribe(Listeners\AddRelationships::class);
$events->subscribe(Listeners\EventHandlers::class);
$events->subscribe(Listeners\SaveVotesToDatabase::class);
$events->subscribe(Listeners\FilterDiscussionListByHotness::class);
$events->subscribe(Access\DiscussionPolicy::class);
},
];