X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fhooks.inc;h=df906a91d4cb9194bb544b48d63981564b9e1def;hb=e6af7f9f8087bc668eb55f3bf5acead018d38ad8;hp=515bcccf3c9f72a22f4bbf79439a3d1a4973c2b8;hpb=3ef9e6f02a4460bf96c65987e0a7b0e17d376a45;p=fa-stable.git diff --git a/includes/hooks.inc b/includes/hooks.inc index 515bcccf..df906a91 100644 --- a/includes/hooks.inc +++ b/includes/hooks.inc @@ -93,6 +93,19 @@ class hooks { // return array($security_areas, $security_sections); } + // + // Invoked for all modules before page header is displayed + // + function pre_header($fun_args) + { + } + // + // Invoked for all modules before page footer is displayed + // + function pre_footer($fun_args) + { + } + // // Price in words. $doc_type is set to document type and can be used to suppress // price in words printing for selected document types. @@ -252,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[$ext]) + { + 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; } /*