From 9aebbcfc7b511843b0ffcaefa0184214bc602ed9 Mon Sep 17 00:00:00 2001 From: Regis Houssin <regis@dolibarr.fr> Date: Tue, 31 May 2011 17:42:51 +0000 Subject: [PATCH] Fix: possibility to have more hooks in the same page New: add left search block hook and extra left block hook --- htdocs/core/class/conf.class.php | 2 +- htdocs/main.inc.php | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 583f6018814..86d002f55cb 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> - * Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr> + * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2006 Jean Heimburger <jean@tiaris.info> * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index c83120d7194..876be43abf0 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1373,10 +1373,14 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me // Search form hook of thirdparty module if (! empty($object->hooks['searchform'])) { + $searchform.='<!-- Begin search form hook area -->'."\n"; + foreach($object->hooks['searchform'] as $module) { $searchform.=$module->printSearchForm(); } + + $searchform.="\n".'<!-- End of search form hook area -->'."\n"; } // Define $bookmarks @@ -1482,19 +1486,23 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me } print "\n"; + print "</div>\n"; + print "<!-- End left vertical menu -->\n"; + + print "\n"; + // Left block hook of thirdparty module if (! empty($object->hooks['leftblock'])) { + print '<!-- Begin left block hook area -->'."\n"; + foreach($object->hooks['leftblock'] as $module) { $module->printLeftBlock(); } + + print "\n".'<!-- End of left block hook area -->'."\n"; } - - print "</div>\n"; - print "<!-- End left vertical menu -->\n"; - - print "\n"; if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print '</div> <!-- End left layout -->'."\n"; else print '</td>'; -- GitLab