From 2556543ec829b0d611248e23c6f39ef16258e390 Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Fri, 5 Dec 2025 17:59:26 +0100 Subject: [PATCH] add missing hooks --- htdocs/public/webportal/css/themes/custom.css.php | 12 ++++++++++++ htdocs/public/webportal/tpl/header.tpl.php | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/public/webportal/css/themes/custom.css.php b/htdocs/public/webportal/css/themes/custom.css.php index bec2de3b4c3..cb30f91bf21 100644 --- a/htdocs/public/webportal/css/themes/custom.css.php +++ b/htdocs/public/webportal/css/themes/custom.css.php @@ -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(); } 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'); diff --git a/htdocs/public/webportal/tpl/header.tpl.php b/htdocs/public/webportal/tpl/header.tpl.php index cd13ea7d3ce..b930080616f 100644 --- a/htdocs/public/webportal/tpl/header.tpl.php +++ b/htdocs/public/webportal/tpl/header.tpl.php @@ -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 @@ -97,8 +98,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); ?> >