Merge pull request #19853 from atm-maxime/new_hook_main_area

New hook printMainArea
This commit is contained in:
Laurent Destailleur 2022-01-19 01:57:39 +01:00 committed by GitHub
commit 499dd859ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2941,7 +2941,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
*/
function main_area($title = '')
{
global $conf, $langs;
global $conf, $langs, $hookmanager;
if (empty($conf->dol_hide_leftmenu)) {
print '<div id="id-right">';
@ -2951,14 +2951,17 @@ function main_area($title = '')
print '<!-- Begin div class="fiche" -->'."\n".'<div class="fiche">'."\n";
$hookmanager->initHooks(array('main'));
$parameters = array();
$reshook = $hookmanager->executeHooks('printMainArea', $parameters); // Note that $action and $object may have been modified by some hooks
print $hookmanager->resPrint;
if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) {
print info_admin($langs->trans("WarningYouAreInMaintenanceMode", $conf->global->MAIN_ONLY_LOGIN_ALLOWED), 0, 0, 1, 'warning maintenancemode');
}
// Permit to add user company information on each printed document by setting SHOW_SOCINFO_ON_PRINT
if (!empty($conf->global->SHOW_SOCINFO_ON_PRINT) && GETPOST('optioncss', 'aZ09') == 'print' && empty(GETPOST('disable_show_socinfo_on_print', 'az09'))) {
global $hookmanager;
$hookmanager->initHooks(array('main'));
$parameters = array();
$reshook = $hookmanager->executeHooks('showSocinfoOnPrint', $parameters);
if (empty($reshook)) {