Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
29091c94
Commit
29091c94
authored
Jun 26, 2018
by
Peter Spicer
Committed by
Robert Lyon
Aug 18, 2019
Browse files
Bug 1837194: Notify plugins when all notifications are deleted.
behatnotneeded Change-Id: I15b94e78e52b2f1abc7942ab341ae1b3a4960398
parent
4665dd4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/module/multirecipientnotification/inbox.php
View file @
29091c94
...
...
@@ -156,6 +156,15 @@ function delete_all_notifications_submit() {
$userid
=
$USER
->
get
(
'id'
);
$type
=
param_variable
(
'type'
,
'all'
);
$plugins
=
plugin_all_installed
();
foreach
(
$plugins
as
$key
=>
$plugin
)
{
$classname
=
generate_class_name
(
$plugin
->
plugintype
,
$plugin
->
name
);
safe_require
(
$plugin
->
plugintype
,
$plugin
->
name
);
if
(
!
is_callable
(
array
(
$classname
,
'notification_delete'
)))
{
unset
(
$plugins
[
$key
]);
}
}
db_begin
();
// delete multirecipient-message separately
...
...
@@ -184,6 +193,11 @@ function delete_all_notifications_submit() {
$msgids
[]
=
$record
->
id
;
}
delete_messages_mr
(
$msgids
,
$userid
);
foreach
(
$plugins
as
$plugin
)
{
$classname
=
generate_class_name
(
$plugin
->
plugintype
,
$plugin
->
name
);
call_static_method
(
$classname
,
'notification_delete'
,
$msgids
,
$userid
,
'module_multirecipient_notification'
);
}
}
$count
=
count
(
$msgids
);
}
...
...
@@ -226,6 +240,12 @@ function delete_all_notifications_submit() {
);
// The update_unread_delete db trigger on notification_internal_activity
// will update the unread column on the usr table.
// And make sure any plugins that want to handle it can do so.
foreach
(
$plugins
as
$plugin
)
{
$classname
=
generate_class_name
(
$plugin
->
plugintype
,
$plugin
->
name
);
call_static_method
(
$classname
,
'notification_delete'
,
$ids
,
$userid
,
'notification_internal_activity'
);
}
}
db_commit
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment