From 9aebbcfc7b511843b0ffcaefa0184214bc602ed9 Mon Sep 17 00:00:00 2001 From: Regis Houssin 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 | 26 +++++++++++++++++--------- 2 files changed, 18 insertions(+), 10 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 * Copyright (C) 2003 Xavier Dutoit * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2006 Jean Heimburger * * 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.=''."\n"; + foreach($object->hooks['searchform'] as $module) { $searchform.=$module->printSearchForm(); } + + $searchform.="\n".''."\n"; } // Define $bookmarks @@ -1482,19 +1486,23 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me } print "\n"; - // Left block hook of thirdparty module - if (! empty($object->hooks['leftblock'])) - { - foreach($object->hooks['leftblock'] as $module) - { - $module->printLeftBlock(); - } - } - print "\n"; print "\n"; print "\n"; + + // Left block hook of thirdparty module + if (! empty($object->hooks['leftblock'])) + { + print ''."\n"; + + foreach($object->hooks['leftblock'] as $module) + { + $module->printLeftBlock(); + } + + print "\n".''."\n"; + } if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print ' '."\n"; else print '';