Added pre_header and pre_footer hooks.
authorJanusz Dobrowolski <janusz@frontaccouting.eu>
Sat, 23 Mar 2013 08:43:38 +0000 (09:43 +0100)
committerJanusz Dobrowolski <janusz@frontaccouting.eu>
Sat, 23 Mar 2013 08:43:38 +0000 (09:43 +0100)
includes/hooks.inc
includes/page/footer.inc
includes/page/header.inc

index 515bcccf3c9f72a22f4bbf79439a3d1a4973c2b8..cde3f34a9471e5af9603245e3f491abfad8b96b5 100644 (file)
@@ -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.
index 633a0fb7d823367e7731d1c1a5cd73045fad67c3..e3d4c261045a26918a3f341e9b1ac2d6fe03872e 100644 (file)
@@ -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);
index 1f63ef9a6641b59cfcaf3b916a8eff50065b0d80..99f3c688940c489e0c82636804631fadcf1cc657 100644 (file)
@@ -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()){