-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathextend.php
40 lines (31 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
34
35
36
37
38
39
40
<?php
/*
* This file is part of webbinaro/adv-extras.
*
* Copyright (c) 2020 Eddie Webbinaro.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace Webbinaro\GpxPreview;
use Flarum\Extend;
use Flarum\Foundation\Application;
use Flarum\Frontend\Document;
use Psr\Http\Message\ServerRequestInterface as Request;
use Flarum\Settings\SettingsRepositoryInterface;
return [
(new Extend\Frontend('forum'))
->js(__DIR__ . '/js/dist/forum.js'),
(new Extend\Frontend('admin'))
->js(__DIR__ . '/js/dist/admin.js'),
new Extend\Locales(__DIR__ . '/resources/locale'),
(new Extend\View())
->namespace('gpx-preview.templates', __DIR__.'/resources/templates'),
(new Extend\ServiceProvider())
->register(Providers\GpxPreviewProvider::class),
(new Extend\Frontend('forum'))
->content(function (Document $document, Request $request) {
$settings = resolve(SettingsRepositoryInterface::class);
$document->head[] = '<script type="text/javascript" src="https://maps.google.com/maps/api/js?key=' . $settings->get('gpx-preview.gkey') . '"></script>';
})
];