This repository has been archived by the owner on Dec 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
index.php
171 lines (137 loc) · 4.53 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
use Pagekit\Blog\Content\ReadmorePlugin;
use Pagekit\Blog\Event\PostListener;
use Pagekit\Blog\Event\RouteListener;
return [
'name' => 'blog',
'autoload' => [
'Pagekit\\Blog\\' => 'src'
],
'nodes' => [
'blog' => [
'name' => '@blog',
'label' => 'Blog',
'controller' => 'Pagekit\\Blog\\Controller\\SiteController',
'protected' => true,
'frontpage' => true
]
],
'routes' => [
'/blog' => [
'name' => '@blog',
'controller' => 'Pagekit\\Blog\\Controller\\BlogController'
],
'/api/blog' => [
'name' => '@blog/api',
'controller' => [
'Pagekit\\Blog\\Controller\\PostApiController',
'Pagekit\\Blog\\Controller\\CommentApiController'
]
]
],
'permissions' => [
'blog: manage own posts' => [
'title' => 'Manage own posts',
'description' => 'Create, edit, delete and publish posts of their own'
],
'blog: manage all posts' => [
'title' => 'Manage all posts',
'description' => 'Create, edit, delete and publish posts by all users'
],
'blog: manage comments' => [
'title' => 'Manage comments',
'description' => 'Approve, edit and delete comments'
],
'blog: post comments' => [
'title' => 'Post comments',
'description' => 'Allowed to write comments on the site'
],
'blog: skip comment approval' => [
'title' => 'Skip comment approval',
'description' => 'User can write comments without admin approval'
],
'blog: comment approval required once' => [
'title' => 'Comment approval required only once',
'description' => 'First comment needs to be approved, later comments are approved automatically'
],
'blog: skip comment min idle' => [
'title' => 'Skip comment minimum idle time',
'description' => 'User can write multiple comments without having to wait in between'
]
],
'menu' => [
'blog' => [
'label' => 'Blog',
'icon' => 'blog:icon.svg',
'url' => '@blog/post',
'active' => '@blog/post*',
'access' => 'blog: manage own posts || blog: manage all posts || blog: manage comments || system: access settings',
'priority' => 110
],
'blog: posts' => [
'label' => 'Posts',
'parent' => 'blog',
'url' => '@blog/post',
'active' => '@blog/post*',
'access' => 'blog: manage own posts || blog: manage all posts'
],
'blog: comments' => [
'label' => 'Comments',
'parent' => 'blog',
'url' => '@blog/comment',
'active' => '@blog/comment*',
'access' => 'blog: manage comments'
],
'blog: settings' => [
'label' => 'Settings',
'parent' => 'blog',
'url' => '@blog/settings',
'active' => '@blog/settings*',
'access' => 'system: access settings'
]
],
'settings' => '@blog/settings',
'config' => [
'comments' => [
'autoclose' => false,
'autoclose_days' => 14,
'blacklist' => '',
'comments_per_page' => 20,
'gravatar' => true,
'max_depth' => 5,
'maxlinks' => 2,
'minidle' => 120,
'nested' => true,
'notifications' => 'always',
'order' => 'ASC',
'replymail' => true,
'require_email' => true
],
'posts' => [
'posts_per_page' => 20,
'comments_enabled' => true,
'markdown_enabled' => true
],
'permalink' => [
'type' => '',
'custom' => '{slug}'
],
'feed' => [
'type' => 'rss2',
'limit' => 20
]
],
'events' => [
'boot' => function ($event, $app) {
$app->subscribe(
new RouteListener,
new PostListener(),
new ReadmorePlugin
);
},
'view.scripts' => function ($event, $scripts) {
$scripts->register('link-blog', 'blog:app/bundle/link-blog.js', '~panel-link');
$scripts->register('post-meta', 'blog:app/bundle/post-meta.js', '~post-edit');
}
]
];