diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9f325fb220e..0b37bf096e2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6401,13 +6401,13 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin $out .= '>'; } if ($tooltip) { - // You can also use 'TranslationString:keyfortooltiponclick' for a tooltip on click. - if (preg_match('/:\w+$/', $tooltip)) { + // You can also use 'TranslationString:keyfortooltiponclick:tooltipdirection' for a tooltip on click or to change tooltip position. + if (strpos($tooltip, ':') !== false) { $tmptooltip = explode(':', $tooltip); } else { $tmptooltip = array($tooltip); } - $out .= $form->textwithpicto($langs->trans($name), $langs->trans($tmptooltip[0]), 1, 'help', '', 0, 3, (empty($tmptooltip[1]) ? '' : 'extra_'.str_replace('.', '_', $field).'_'.$tmptooltip[1])); + $out .= $form->textwithpicto($langs->trans($name), $langs->trans($tmptooltip[0]), (empty($tmptooltip[2]) ? 1 : $tmptooltip[2]), 'help', '', 0, 3, (empty($tmptooltip[1]) ? '' : 'extra_'.str_replace('.', '_', $field).'_'.$tmptooltip[1])); } else { $out .= $langs->trans($name); }