From d49780fb13e30f5cb97912a7d26e9716802019e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Dec 2011 23:38:54 +0100 Subject: [PATCH] New: Add hook on index statistics array --- htdocs/conf/conf.php.example | 5 +++-- htdocs/index.php | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index bfbe4616ec6..f3cd80a6309 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -2,8 +2,9 @@ # Dolibarr example for conf.php file # # Do not edit this file without changing its name. -# This file is used by Dolibarr setup process to create true Dolibarr -# config file called "conf.php". +# This file is an example of empty config file for Dolibarr than can be used to create "conf.php". +# +# Warning: Be sure to not add line feed or spaces after closing php tag. # diff --git a/htdocs/index.php b/htdocs/index.php index 42ce536bccb..2d0eca51a78 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -33,6 +33,10 @@ require_once(DOL_DOCUMENT_ROOT."/boxes.php"); if (! isset($_GET["mainmenu"])) $_GET["mainmenu"]="home"; +include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); +$hookmanager=new HookManager($db); +$hookmanager->callHooks(array('index')); + /* * Actions @@ -250,6 +254,11 @@ if ($user->societe_id == 0) } } + $object=(object) array(); + $parameters=array(); + $action=''; + $reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + print ''; }