X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fhooks.inc;h=b27fc35501788654afcd15ab69df50d23d5ad73c;hb=f9c8b87e01c36aadf85c4015ffab8a2d0a1cbae2;hp=fedbc4c22cf8d4b59eefd209c1d2ffe605aff432;hpb=f8f29c33f36dda542da9ad33fdfcf6849fcd9a1d;p=fa-stable.git diff --git a/includes/hooks.inc b/includes/hooks.inc index fedbc4c2..b27fc355 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)) + { + 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; } /* @@ -278,11 +294,11 @@ function hook_invoke_first($method, &$data, $opts=null) if (method_exists($hook, $method)) { set_ext_domain('modules/'.$ext); $result = $hook->$method($data, $opts); + set_ext_domain(); if (isset($result)) break; } } - set_ext_domain(); return $result; } /* @@ -300,11 +316,11 @@ function hook_invoke_last($method, &$data, $opts=null) if (method_exists($hook, $method)) { set_ext_domain('modules/'.$ext); $result = $hook->$method($data, $opts); + set_ext_domain(); if (isset($result)) break; } } - set_ext_domain(); return $result; } //------------------------------------------------------------------------------------------