Repository navigation
Expand file tree
/
Copy pathPlugin.php
More file actions
60 lines (51 loc) · 1.69 KB
/
Copy pathPlugin.php
File metadata and controls
60 lines (51 loc) · 1.69 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
declare(strict_types=1);
namespace NumenCode\Fundamentals;
use Detection\MobileDetect;
use NumenCode\Fundamentals\Bootstrap\BackendOverride;
use NumenCode\Fundamentals\Bootstrap\ConfigOverride;
use NumenCode\Fundamentals\Bootstrap\TranslateIntegration;
use NumenCode\Fundamentals\Extensions\TwigExtension;
use NumenCode\Fundamentals\FormWidgets\RelationRepeater;
use System\Classes\PluginBase;
class Plugin extends PluginBase
{
public function pluginDetails(): array
{
return [
'name' => 'numencode.fundamentals::lang.plugin.name',
'description' => 'numencode.fundamentals::lang.plugin.description',
'author' => 'Blaz Orazem',
'icon' => 'icon-cogs',
'homepage' => 'https://www.numencode.com',
];
}
public function register(): void
{
require_once __DIR__ . '/helpers.php';
// One user-agent detector per request, shared by detect() and device_type()
$this->app->singleton(MobileDetect::class, fn () => new MobileDetect());
}
public function boot(): void
{
(new ConfigOverride())->init();
(new BackendOverride())->init();
(new TranslateIntegration())->init();
}
public function registerMarkupTags(): array
{
return [
'filters' => TwigExtension::filters(),
'functions' => TwigExtension::functions(),
];
}
public function registerFormWidgets(): array
{
return [
RelationRepeater::class => [
'label' => 'numencode.fundamentals::lang.formwidget.relationrepeater',
'code' => 'relationrepeater',
],
];
}
}