-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.php
77 lines (72 loc) · 2.43 KB
/
index.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
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
<?php
use Kirby\Cms\App as Kirby;
Kirby::plugin('moritzebeling/kirby-panel-button', [
'fields' => [
'button' => [
'props' => [
'label' => function (string $label = 'Button') {
return $label;
},
'text' => function (string $text = 'Click here') {
return $text;
},
'url' => function (string $url) {
return $url;
},
'theme' => function (string $theme = null) {
return $theme;
},
'icon' => function (string $icon = 'refresh') {
return $icon;
},
'open' => function (bool $open = false) {
return $open;
},
'reload' => function (bool $reload = false) {
return $reload;
},
'help' => function (string $help = null) {
return $help;
},
],
'computed' => [
'text' => function () {
if( $text = $this->text ){
$text = $this->model()->toSafeString($text);
return $text;
}
},
'url' => function () {
if( $url = $this->url ){
$url = $this->model()->toSafeString($url);
return $url;
}
}
],
]
],
// 'sections' => [
// 'button' => [
// 'props' => [
// 'headline' => function (string $headline = 'Button section') {
// return $headline;
// },
// 'text' => function (string $text = null) {
// return $text;
// },
// 'button' => function (string $text = 'Click here') {
// return $text;
// },
// 'url' => function (string $url) {
// return $url;
// },
// 'theme' => function (string $theme = 'info') {
// return $theme;
// },
// 'icon' => function (string $icon = 'refresh') {
// return $icon;
// }
// ],
// ]
// ],
]);