forked from FriendsOfFlarum/transliterator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextend.php
More file actions
32 lines (25 loc) · 896 Bytes
/
extend.php
File metadata and controls
32 lines (25 loc) · 896 Bytes
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
<?php
/*
* This file is part of fof/transliterator
*
* Copyright (c) FriendsOfFlarum.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FoF\Transliterator;
use Flarum\Discussion\Event\Saving;
use Flarum\Extend;
use Flarum\Frontend\Document;
return [
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js')
->content(function (Document $document) {
$document->payload['fof-transliterator.packages'] = array_keys(Transliterator::$transliterators);
}),
new Extend\Locales(__DIR__.'/locale'),
(new Extend\Routes('api'))
->post('/fof/transliterator/parse', 'fof.transliterator.parse', Controllers\ParseOldDiscussionsController::class),
(new Extend\Event())
->listen(Saving::class, Listeners\TransliterateUrl::class),
];