-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathNotes.php
More file actions
152 lines (142 loc) · 4.64 KB
/
Notes.php
File metadata and controls
152 lines (142 loc) · 4.64 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
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
<?php
namespace addons\notes;
use think\Lang;
use think\Addons;
use app\common\library\Menu;
/**
* 后台笔记
*/
class Notes extends Addons
{
/**
* 插件安装方法
* @return bool
*/
public function install()
{
$menu =
[
[
"name" => "notes",
"title" => "后台笔记",
"icon" => "fa fa-list",
"ismenu" => 1,
"sublist" => [
[
"name" => "notes/note",
"title" => "笔记管理",
"icon" => "fa fa-file",
"ismenu" => 1,
"sublist" => [
[
"name" => "notes/note/index",
"title" => "首页"
],
[
"name" => "notes/note/add",
"title" => "添加"
],
[
"name" => "notes/note/edit",
"title" => "编辑"
],
[
"name" => "notes/note/del",
"title" => "删除"
],
[
"name" => "notes/note/multi",
"title" => "批量更新"
]
]
],
[
"name" => "notes/tag",
"title" => "标签管理",
"icon" => "fa fa-tags",
"ismenu" => 1,
"sublist" => [
[
"name" => "notes/tag/index",
"title" => "首页"
],
[
"name" => "notes/tag/add",
"title" => "添加"
],
[
"name" => "notes/tag/edit",
"title" => "编辑"
],
[
"name" => "notes/tag/del",
"title" => "删除"
],
[
"name" => "notes/tag/multi",
"title" => "批量更新"
]
]
],
[
"name" => "notes/fast",
"title" => "快速记录",
"ismenu" => 0,
"sublist" => [
[
"name" => "notes/fast/index",
"title" => "首页"
],
[
"name" => "notes/fast/note",
"title" => "添加/编辑"
],
[
"name" => "notes/fast/del",
"title" => "删除"
],
]
],
]
]
];
Menu::create($menu);
return true;
}
/**
* 插件卸载方法
* @return bool
*/
public function uninstall()
{
Menu::delete('notes');
return true;
}
/**
* 插件启用方法
* @return bool
*/
public function enable()
{
Menu::enable('notes');
return true;
}
/**
* 插件禁用方法
* @return bool
*/
public function disable()
{
Menu::disable('notes');
return true;
}
/**
* 应用初始化
* @return void
*/
public function moduleInit()
{
$langFile = __DIR__ . DS . 'lang' . DS . request()->langset() . EXT;
Lang::load($langFile);
}
}