From 13be2db70d328ecfd12dd20fb8f38d7d8850b186 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sat, 23 Mar 2013 09:43:38 +0100 Subject: [PATCH] Added pre_header and pre_footer hooks. --- includes/hooks.inc | 13 +++++++++++++ includes/page/footer.inc | 3 +++ includes/page/header.inc | 5 ++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/includes/hooks.inc b/includes/hooks.inc index 515bcccf..cde3f34a 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. diff --git a/includes/page/footer.inc b/includes/page/footer.inc index 633a0fb7..e3d4c261 100644 --- a/includes/page/footer.inc +++ b/includes/page/footer.inc @@ -13,6 +13,9 @@ function page_footer($no_menu=false, $is_index=false) { global $path_to_root, $js_lib, $Validate, $Editors, $Ajax, $sql_queries; + $page_header_args = func_get_args(); + hook_invoke_all('pre_footer', $page_header_args); + include_once($path_to_root."/themes/".user_theme()."/renderer.php"); $rend = new renderer(); $rend->menu_footer($no_menu, $is_index); diff --git a/includes/page/header.inc b/includes/page/header.inc index 1f63ef9a..99f3c688 100644 --- a/includes/page/header.inc +++ b/includes/page/header.inc @@ -113,7 +113,10 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js="" if (isset($_SESSION["App"]) && is_object($_SESSION["App"])) $_SESSION["App"]->selected_application = isset($_SESSION["App"]->applications[$sel_app]) ? $sel_app : 'orders'; - + + $page_header_args = func_get_args(); + hook_invoke_all('pre_header', $page_header_args); + $encoding = $_SESSION['language']->encoding; if (!headers_sent()){ -- 2.30.2