X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fhooks.inc;h=b27fc35501788654afcd15ab69df50d23d5ad73c;hb=85f86f5985c98cb9da31d583d0ab74280cd8b3a5;hp=cde3f34a9471e5af9603245e3f491abfad8b96b5;hpb=13be2db70d328ecfd12dd20fb8f38d7d8850b186;p=fa-stable.git diff --git a/includes/hooks.inc b/includes/hooks.inc index cde3f34a..b27fc355 100644 --- a/includes/hooks.inc +++ b/includes/hooks.inc @@ -265,17 +265,20 @@ function hook_invoke_all($method, &$data, $opts=null) global $Hooks; $return = array(); - foreach($Hooks as $ext => $hook) - if (method_exists($hook, $method)) { - set_ext_domain('modules/'.$ext); - $result = $hook->$method($data, $opts); - if (isset($result) && is_array($result)) { - $return = array_merge_recursive($return, $result); - } else if (isset($result)) { - $return[] = $result; - } - set_ext_domain(); - } + if (isset($Hooks)) + { + foreach($Hooks as $ext => $hook) + if (method_exists($hook, $method)) { + set_ext_domain('modules/'.$ext); + $result = $hook->$method($data, $opts); + if (isset($result) && is_array($result)) { + $return = array_merge_recursive($return, $result); + } else if (isset($result)) { + $return[] = $result; + } + set_ext_domain(); + } + } return $return; } /*