From e212395f00283c68313cc6f470b9ce0a30bf2f1d Mon Sep 17 00:00:00 2001 From: alsoft10 Date: Thu, 20 Jan 2022 12:12:59 +0530 Subject: [PATCH 1/2] PR REQUEST #19679 --- htdocs/main.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4ec8767a801..5ae92c702a0 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1766,6 +1766,14 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr } } } + + //If you want to load custom javascript file from your selected theme directory + if (!empty($conf->global->ALLOW_THEME_JS)) { + $theme_js = dol_buildpath('/theme/'.$conf->theme.'/'.$conf->theme.'.js', 0); + if (file_exists($theme_js)) { + print ''."\n"; + } + } if (!empty($head)) { print $head."\n"; From 0bb697c3aed4cb4a6a68ee3131e671c2354bc7cd Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 20 Jan 2022 06:47:57 +0000 Subject: [PATCH 2/2] Fixing style errors. --- htdocs/main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 5ae92c702a0..fd811877295 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1766,9 +1766,9 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr } } } - + //If you want to load custom javascript file from your selected theme directory - if (!empty($conf->global->ALLOW_THEME_JS)) { + if (!empty($conf->global->ALLOW_THEME_JS)) { $theme_js = dol_buildpath('/theme/'.$conf->theme.'/'.$conf->theme.'.js', 0); if (file_exists($theme_js)) { print ''."\n";