Merge pull request #36556 from thersane-john/fix_webportal_missing_hooks

WebPortal missing hooks
This commit is contained in:
Laurent Destailleur 2025-12-15 16:29:42 +01:00 committed by GitHub
commit 31e1ce2ca6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 1 deletions

View file

@ -48,6 +48,13 @@ session_cache_limiter('public');
require_once __DIR__.'/../../webportal.main.inc.php';
dol_include_once('/webportal/class/webPortalTheme.class.php');
/**
* @var Conf $conf
* @var HookManager $hookmanager
* @var Translate $langs
* @var Context $context
*/
// Define css type
top_httphead('text/css');
/*
@ -85,5 +92,10 @@ $webPortalTheme = new WebPortalTheme();
}
<?php
$hookmanager->initHooks(array('webPortalCustomCss'));
$parameters = array();
$hookmanager->executeHooks('webPortalCustomCss', $parameters, $webPortalTheme);
print $hookmanager->resPrint;
print '/* Here, the content of the common custom CSS defined into Home - Setup - Display - CSS */'."\n";
print getDolGlobalString('WEBPORTAL_CUSTOM_CSS');

View file

@ -18,6 +18,7 @@
/**
* @var Context $context Object context for webportal
* @var HookManager $hookmanager
* @var Translate $langs
* @@var string[] $vars['body-class'] more CSS classes for body
* @@var string[] $vars['body-theme'] theme css to apply default is custom
@ -101,8 +102,13 @@ top_httphead();
$bodyAttributes['class'] = $vars['body-class'];
}
$bodyCompiledAttributes = commonHtmlAttributeBuilder($bodyAttributes);
$parameters = array(
'bodyAttributes' => &$bodyAttributes
);
$hookmanager->executeHooks('webPortalHeader', $parameters, $context);
print $hookmanager->resPrint;
$bodyCompiledAttributes = commonHtmlAttributeBuilder($bodyAttributes);
?>
</head>
<body <?php print empty($bodyCompiledAttributes) ? '' : implode(' ', $bodyCompiledAttributes); ?> >