Skip to content
GitLab
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
d958e5fc
Commit
d958e5fc
authored
Oct 26, 2006
by
Penny Leach
Browse files
added handle_event function
parent
f57ef177
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/mahara.php
View file @
d958e5fc
...
...
@@ -542,6 +542,27 @@ function redirect($location) {
exit
;
}
function
handle_event
(
$event
)
{
if
(
!
$e
=
get_record
(
'event'
,
'name'
,
$event
))
{
throw
new
Exception
(
"Invalid event"
);
}
$plugintypes
=
plugin_types
();
foreach
(
$plugintypes
as
$name
)
{
if
(
$subs
=
get_records
(
'event_subscription_'
.
$name
,
'event'
,
$event
))
{
foreach
(
$subs
as
$sub
)
{
$classname
=
'Plugin'
.
ucfirst
(
$name
)
.
ucfirst
(
$sub
->
plugin
);
try
{
call_static_method
(
$classname
,
$sub
->
callfunction
);
}
catch
(
Exception
$e
)
{
log_warn
(
"Event
$event
caused an exception from plugin
$classname
"
.
"with function
$sub->callfunction
. Continuing with event handlers"
);
}
}
}
}
}
/**
* Used by XMLDB
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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