-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Extension.php
executable file
·47 lines (41 loc) · 1.42 KB
/
Extension.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
47
<?php
namespace Igniter\Translate;
use Igniter\Translate\Classes\EventRegistry;
use Illuminate\Support\Facades\Event;
use System\Classes\BaseExtension;
/**
* Translate Extension Information File
*/
class Extension extends BaseExtension
{
public function register()
{
Event::listen('admin.form.extendFieldsBefore', function ($widget) {
EventRegistry::instance()->registerFormFieldReplacements($widget);
}, -1);
}
public function boot()
{
EventRegistry::instance()->bootTranslatableModels();
}
public function registerComponents()
{
return [
\Igniter\Translate\Components\LocalePicker::class => [
'code' => 'localePicker',
'name' => 'Language Picker',
'description' => 'Displays a dropdown to select a front-end language.',
],
];
}
public function registerFormWidgets()
{
return [
\Igniter\Translate\FormWidgets\TRLText::class => ['code' => 'trltext'],
\Igniter\Translate\FormWidgets\TRLTextarea::class => ['code' => 'trltextarea'],
\Igniter\Translate\FormWidgets\TRLRichEditor::class => ['code' => 'trlricheditor'],
\Igniter\Translate\FormWidgets\TRLMarkdownEditor::class => ['code' => 'trlmarkdowneditor'],
\Igniter\Translate\FormWidgets\TRLRepeater::class => ['code' => 'trlrepeater'],
];
}
}