forked from mplodowski/dynamicpdf-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPlugin.php
More file actions
111 lines (100 loc) · 3.05 KB
/
Plugin.php
File metadata and controls
111 lines (100 loc) · 3.05 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
namespace Renatio\DynamicPDF;
use Backend\Facades\Backend;
use Renatio\DynamicPDF\Classes\ServiceProvider;
use System\Classes\PluginBase;
use System\Classes\PluginManager;
/**
* Class Plugin
* @package Renatio\DynamicPDF
*/
class Plugin extends PluginBase
{
/**
* @return array
*/
public function pluginDetails()
{
return [
'name' => 'renatio.dynamicpdf::lang.plugin.name',
'description' => 'renatio.dynamicpdf::lang.plugin.description',
'author' => 'Renatio',
'icon' => 'icon-file-pdf-o',
'homepage' => 'http://octobercms.com/plugin/renatio-dynamicpdf',
];
}
/**
* @return void
*/
public function boot()
{
$this->app->register(ServiceProvider::class);
}
/**
* @return array
*/
public function registerNavigation()
{
return [
'dynamicpdf' => [
'label' => 'renatio.dynamicpdf::lang.menu.label',
'url' => Backend::url('renatio/dynamicpdf/templates'),
'icon' => 'icon-file-pdf-o',
'permissions' => ['renatio.dynamicpdf.*'],
'order' => 500,
'sideMenu' => [
'templates' => [
'label' => 'renatio.dynamicpdf::lang.templates.templates',
'icon' => 'icon-file-text-o',
'url' => Backend::url('renatio/dynamicpdf/templates'),
'permissions' => ['renatio.dynamicpdf.manage_templates'],
],
'layouts' => [
'label' => 'renatio.dynamicpdf::lang.templates.layouts',
'icon' => 'icon-th-large',
'url' => Backend::url('renatio/dynamicpdf/layouts'),
'permissions' => ['renatio.dynamicpdf.manage_layouts'],
]
]
]
];
}
/**
* @return array
*/
public function registerPermissions()
{
return [
'renatio.dynamicpdf.manage_templates' => [
'tab' => 'renatio.dynamicpdf::lang.permissions.tab',
'label' => 'renatio.dynamicpdf::lang.permissions.manage_templates',
],
'renatio.dynamicpdf.manage_layouts' => [
'tab' => 'renatio.dynamicpdf::lang.permissions.tab',
'label' => 'renatio.dynamicpdf::lang.permissions.manage_layouts',
]
];
}
/**
* @return array
*/
public function registerMarkupTags()
{
if (PluginManager::instance()->exists('RainLab.Translate')) {
return [];
}
return [
'filters' => [
'_' => ['Lang', 'get'],
'__' => ['Lang', 'choice'],
]
];
}
/**
* @return array
*/
public function registerSettings()
{
return [];
}
}