diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-05-23 09:45:26 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-05-23 09:45:26 +0000 |
commit | f2883477d14a300b5364f21fc95f5bc871a39d8d (patch) | |
tree | 9e383e29eda05a938264a52a2606739e47937f2d /engine/lib/elgglib.php | |
parent | dcbc30908a7d2f49e581f7bc772f3d848708844f (diff) | |
download | elgg-f2883477d14a300b5364f21fc95f5bc871a39d8d.tar.gz elgg-f2883477d14a300b5364f21fc95f5bc871a39d8d.tar.bz2 |
trigger_event now passes the actual event details on 'all'
git-svn-id: https://code.elgg.org/elgg/trunk@689 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r-- | engine/lib/elgglib.php | 28 |
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;
}
|