From d28d94b3a8e19ba3cbf79db042d6f786f50e27b2 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 23 May 2008 10:01:12 +0000 Subject: Similar tweak as for events, but with plugin hooks git-svn-id: https://code.elgg.org/elgg/trunk@690 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index c71d6fb6c..cdcba7dda 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -782,7 +782,7 @@ if (!empty($CONFIG->hooks['all'][$entity_type]) && is_array($CONFIG->hooks['all'][$entity_type])) { foreach($CONFIG->hooks['all'][$entity_type] as $hookfunction) { - $temp_return_value = $hookfunction('all', $entity_type, $returnvalue, $params); + $temp_return_value = $hookfunction($hook, $entity_type, $returnvalue, $params); if (!is_null($temp_return_value)) $returnvalue = $temp_return_value; } } @@ -792,7 +792,17 @@ if (!empty($CONFIG->hooks[$hook]['all']) && is_array($CONFIG->hooks[$hook]['all'])) { foreach($CONFIG->hooks[$hook]['all'] as $hookfunction) { - $temp_return_value = $hookfunction($hook, 'all', $returnvalue, $params); + $temp_return_value = $hookfunction($hook, $entity_type, $returnvalue, $params); + if (!is_null($temp_return_value)) $returnvalue = $temp_return_value; + } + } + + if (!isset($CONFIG->hooks['all']['all'])) + return $returnvalue; + + if (!empty($CONFIG->hooks['all']['all']) && is_array($CONFIG->hooks[$hook]['all'])) { + foreach($CONFIG->hooks['all']['all'] as $hookfunction) { + $temp_return_value = $hookfunction($hook, $entity_type, $returnvalue, $params); if (!is_null($temp_return_value)) $returnvalue = $temp_return_value; } } -- cgit v1.2.3