add app_destroy hook which allows addons to perform post delete actions

This commit is contained in:
Mario Vavti 2018-10-02 14:29:56 +02:00
parent 72abe5f3d3
commit 67f19745fd
3 changed files with 8 additions and 0 deletions

View File

@ -623,6 +623,7 @@ class Apps {
intval(TERM_OBJ_APP), intval(TERM_OBJ_APP),
intval($x[0]['id']) intval($x[0]['id'])
); );
call_hooks('app_destroy', $x[0]);
} }
else { else {
$r = q("update app set app_deleted = 1 where app_id = '%s' and app_channel = %d", $r = q("update app set app_deleted = 1 where app_id = '%s' and app_channel = %d",

4
doc/hook/app_destroy.bb Normal file
View File

@ -0,0 +1,4 @@
[h2]app_destroy[/h2]
Allows addons to perform some post delete actions.

View File

@ -52,6 +52,9 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the
[zrl=[baseurl]/help/hook/api_perm_is_allowed]api_perm_is_allowed[/zrl] [zrl=[baseurl]/help/hook/api_perm_is_allowed]api_perm_is_allowed[/zrl]
Called when perm_is_allowed() is executed from an API call. Called when perm_is_allowed() is executed from an API call.
[zrl=[baseurl]/help/hook/app_destroy]app_destroy[/zrl]
Called when an app is deleted
[zrl=[baseurl]/help/hook/app_installed_filter]app_installed_filter[/zrl] [zrl=[baseurl]/help/hook/app_installed_filter]app_installed_filter[/zrl]
Called when determining whether an app is installed Called when determining whether an app is installed