aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/elgglib.php28
1 files changed, 21 insertions, 7 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 57b8c71c8..c71d6fb6c 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -649,6 +649,27 @@
}
}
}
+ if (!empty($CONFIG->events['all'][$object_type]) && is_array($CONFIG->events[$event][$object_type])) {
+ foreach($CONFIG->events['all'][$object_type] as $eventfunction) {
+ if ($eventfunction($event, $object_type, $object) === false) {
+ return false;
+ }
+ }
+ }
+ if (!empty($CONFIG->events[$event]['all']) && is_array($CONFIG->events[$event][$object_type])) {
+ foreach($CONFIG->events[$event]['all'] as $eventfunction) {
+ if ($eventfunction($event, $object_type, $object) === false) {
+ return false;
+ }
+ }
+ }
+ if (!empty($CONFIG->events['all']['all']) && is_array($CONFIG->events[$event][$object_type])) {
+ foreach($CONFIG->events['all']['all'] as $eventfunction) {
+ if ($eventfunction($event, $object_type, $object) === false) {
+ return false;
+ }
+ }
+ }
return true;
}
@@ -678,16 +699,9 @@
* @return true|false Depending on success
*/
function trigger_event($event, $object_type, $object = null) {
-
$return = true;
$return1 = events($event, $object_type, "", null, true, $object);
if (!is_null($return1)) $return = $return1;
- $return2 = events('all', $object_type, "", null, true, $object);
- if (!is_null($return2)) $return = $return2;
- $return3 = events($event, 'all', "", null, true, $object);
- if (!is_null($return3)) $return = $return3;
- $return4 = events('all', 'all', "", null, true, $object);
- if (!is_null($return4)) $return = $return4;
return $return;
}