-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpluginLoader.php
More file actions
173 lines (152 loc) · 5.94 KB
/
pluginLoader.php
File metadata and controls
173 lines (152 loc) · 5.94 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php
require_once 'vendor/autoload.php';
/**
* Created by PhpStorm.
* User: User
* Date: 06.06.2017
* Time: 14:06
*/
class pluginLoader extends udvidePlugin
{
public function __construct()
{
}
//<editor-fold desc="Target">
/**
* Your code to modify the target before creation
* return true as "go-ahead" and false to abort silently
* throw a PluginException to indicate a problem to the user
* @param target $target
* @return boolean
*/
public function onTargetCreate(target &$target): bool {return true;}
/**
* Your code to modify the target before change
* return true as "go-ahead" and false to abort silently
* throw a PluginException to indicate a problem to the user
* $target are the values written to what was previously $subject
* so make $target what you want in the end and $subject-s name what target should be deleted
* return false and create a new target yourself, if you want to prevent the original from being deleted
* @param target $target
* @param target $subject
* @return boolean
*/
public function onTargetUpdate(target &$target, target &$subject): bool {return true;}
/**
* Your code to modify the target before deletion
* return true as "go-ahead" and false to abort silently
* throw a PluginException to indicate a problem to the user
* @param target $target
* @return boolean
*/
public function onTargetDelete(target &$target): bool {return true;}
// public function onTargetRead(&$target); // stretch goal since todo objects aren't read as objects
//</editor-fold>
//<editor-fold desc="User">
/**
* Your code to modify the user before creation
* return true as "go-ahead" and false to abort silently
* throw a PluginException to indicate a problem to the user
* @param user $user
* @return boolean
*/
public function onUserCreate(user &$user): bool {return true;}
/**
* Your code to modify the user before change
* return true as "go-ahead" and false to abort silently
* throw a PluginException to indicate a problem to the user
* $user are the values written to what was previously $subject
* so make $user what you want in the end and $subject-s name what target should be deleted
* return false and create a new user yourself, if you want to prevent the original from being deleted // todo docu example
* @param user $user
* @param user $subject
* @return boolean
*/
public function onUserUpdate(user &$user, user $subject): bool {return true;}
/**
* Your code to modify the user before deletion
* return true as "go-ahead" and false to abort silently
* throw a PluginException to indicate a problem to the user
* @param user $user
* @return boolean
*/
public function onUserDelete(&$user): bool {return true;}
// public function onUserRead(&$target); // stretch goal since todo objects aren't read as objects
//</editor-fold>
//<editor-fold desc="Map">
/**
* Your code to modify the map before creation
* return true as "go-ahead" and false to abort silently
* throw a PluginException to indicate a problem to the user
* @param map $map
* @return boolean
*/
public function onMapCreate(map &$map): bool {return true;}
/**
* Your code to modify the map before change
* return true as "go-ahead" and false to abort silently
* throw a PluginException to indicate a problem to the user
* $map are the values written to what was previously $subject
* so make $map what you want in the end and $subject-s name what target should be deleted
* return false and create a new user yourself, if you want to prevent the original from being deleted // todo docu example
* @param map $map
* @param map $subject
* @return boolean
*/
public function onMapUpdate(map &$map, map &$subject): bool {return true;}
/**
* Your code to modify the map before deletion
* return true as "go-ahead" and false to abort silently
* throw a PluginException to indicate a problem to the user
* @param map $map
* @return bool
*/
public function onMapDelete(map &$map): bool {return true;}
// public function onUserRead(&$target); // stretch goal since todo objects aren't read as objects
//</editor-fold>
/**
* Your code to modify a user before he logs in
* only a valid User can be logged in
* @param user $user
* @return bool
*/
public function onLogin(user &$user): bool {return true;}
/**
* Your code to modify a editor-permission grant
* @param user $user
* @param target $target
* @param $editor
* @return bool
*/
public function onEditorAssign(user &$user, target &$target, &$editor): bool{return true;} // todo
/**
* Your code to modify a editor-permission revoke
* @param user $user
* @param target $target
* @param $editor
* @return bool
*/
public function onEditorDivest(user &$user, target &$target, &$editor): bool {return true;} // todo
// public function onEditorRead(user &$user, target &$target):bool // todo stretch
// public function onLog(&$log); // stretch goal since todo low reward
/**
* Your code to modify a Read Access from a mobile Client
* @param target $target
* @return bool
*/
public function onMobileRead(target &$target): bool {return true;} // the content of the Target is what is sent in the end
public function onCustomTargetCreate(): bool {return true;}
/**
* In case you need to setup something
* @return bool
*/
public function onSetup(): bool {return true;}
/**
* You have to tell us somethings about your Plugin - see udvidePluginAbout
* @return udvidePluginAbout
*/
public function aboutMe(): udvidePluginAbout
{
// TODO: Implement aboutMe() method.
}
}