-
Notifications
You must be signed in to change notification settings - Fork 1
/
areas.php
43 lines (39 loc) · 1.78 KB
/
areas.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
<?php
use bvdputte\kirbyLogbook\logbook;
return [
'logbook' => function () {
$accessPermission = logbook::hasAccess(kirby()->user());
return [
'label' => 'LogBook', // label for the menu and the breadcrumb
'icon' => 'book', // icon for the menu and breadcrumb
// optional replacement for the breadcrumb label
// 'breadcrumbLabel' => function () {
// return 'LogBook';
// },
'disabled' => false,
'menu' => $accessPermission ? true : 'disabled', // Enable/disable from the menu
'link' => 'logbook', // link to the main area view
'views' => [
[
'pattern' => 'logbook', //`panel` slug is automatically prepended
'action' => function () {
// Block unauthorized access
logbook::checkAccess(kirby()->user());
return [
'component' => 'k-logbook-area', //the Vue component can be defined in the `index.js` of your plugin
'title' => 'LogBook', // the document title for the current view
'props' => [
'title' => 'LogBook',
'logfiles' => logbook::getLogfiles(),
'selectedLogfile' => logbook::getDefaultLogfile(),
'hasKirbyLogPlugin' => logbook::hasKirbyLogPlugin(),
'maxLogLines' => logbook::getMaxLogLines(),
'limit' => logbook::getPaginationSize()
],
];
}
]
]
];
}
];