Skip to content
Snippets Groups Projects
Commit 7d6d4adc authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix combo for multicompany not visible where there is other hooks by

other modules
parent 9cf6c43f
No related branches found
No related tags found
No related merge requests found
......@@ -166,7 +166,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
}
$conf_css = $themepath."?lang=".$langs->defaultlang;
// Select templates
// Select templates dir
if (! empty($conf->modules_parts['tpl'])) // Using this feature slow down application
{
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl/'));
......@@ -205,6 +205,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
// Should be an array with differents options in $hookmanager->resArray
$parameters=array('entity' => GETPOST('entity','int'));
$reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. resArray is filled by hook.
$morelogincontent = $hookmanager->resArray['options']; // TODO Use here a resprints
// Login
$login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin));
......
......@@ -17,9 +17,7 @@
*/
// Need global variable $title to be defined by caller (like dol_loginfunction)
// Caller can also set $theResArray = array(['options']=>array('js'=>..., 'table'=>...);
// Caller can also set $morelogincontent = array(['options']=>array('js'=>..., 'table'=>...);
header('Cache-Control: Public, must-revalidate');
header("Content-type: text/html; charset=".$conf->file->character_set_client);
......@@ -125,8 +123,8 @@ if ($disablenofollow) echo '</a>';
</span>
</td></tr>
<?php
if (! empty($hookmanager->resArray['options'])) {
foreach ($hookmanager->resArray['options'] as $format => $option)
if (! empty($morelogincontent) && is_array($morelogincontent)) {
foreach ($morelogincontent as $format => $option)
{
if ($format == 'table') {
echo '<!-- Option by hook -->';
......@@ -280,8 +278,8 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) {
<?php if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; ?>
<?php
if (! empty($hookmanager->resArray['options'])) {
foreach ($hookmanager->resArray['options'] as $format => $option)
if (! empty($morelogincontent) && is_array($morelogincontent)) {
foreach ($morelogincontent as $format => $option)
{
if ($format == 'js') {
echo "\n".'<!-- Javascript by hook -->';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment