Fix warning

This commit is contained in:
Laurent Destailleur
2025-11-02 15:34:10 +01:00
parent 4b08955478
commit 54fd942a9f

View File

@@ -6604,13 +6604,13 @@ function img_searchclear($titlealt = 'default', $other = '')
/**
* Show information in HTML for admin users or standard users
*
* @param string $text Text info
* @param integer $infoonimgalt Info is shown only on alt of star picto, otherwise it is show on output after the star picto
* @param int $nodiv No div
* @param string $admin '1'=Info for admin users. '0'=Info for standard users (change only the look), 'info', 'error', 'warning', 'xxx'=Other
* @param string $morecss More CSS ('', 'warning', 'error')
* @param string $textfordropdown Show a text to click to dropdown the info box.
* @param string $picto '' or 'warning'
* @param string $text Text info
* @param integer $infoonimgalt Info is shown only on alt of star picto, otherwise it is show on output after the star picto
* @param int $nodiv No div
* @param string|int $admin '1'=Info for admin users. '0'=Info for standard users (change only the look), 'info', 'error', 'warning', 'xxx'=Other
* @param string $morecss More CSS ('', 'warning', 'error')
* @param string $textfordropdown Show a text to click to dropdown the info box.
* @param string $picto '' or 'warning'
* @return string String with info text
*/
function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss = 'hideonsmartphone', $textfordropdown = '', $picto = '')
@@ -6624,12 +6624,12 @@ function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss
$textfordropdown = '';
}
$class = (empty($admin) ? 'undefined' : ($admin == '1' ? 'info' : $admin));
$class = (empty($admin) ? 'undefined' : ((string) $admin == '1' ? 'info' : $admin));
$fa = 'info-circle';
if ($picto == 'warning') {
$fa = 'exclamation-triangle';
}
$result = ($nodiv ? '' : '<div class="wordbreak ' . $class . ($morecss ? ' ' . $morecss : '') . ($textfordropdown ? ' hidden' : '') . '">') . '<span class="fa fa-' . $fa . '" title="' . dol_escape_htmltag($admin ? $langs->trans('InfoAdmin') : $langs->trans('Note')) . '"></span> ';
$result = ($nodiv ? '' : '<div class="wordbreak ' . $class . ($morecss ? ' ' . $morecss : '') . ($textfordropdown ? ' hidden' : '') . '">') . '<span class="fa fa-' . $fa . '" title="' . dol_escape_htmltag((string) $admin ? $langs->trans('InfoAdmin') : $langs->trans('Note')) . '"></span> ';
$result .= dol_escape_htmltag($text, 1, 0, 'div,span,b,br,a');
$result .= ($nodiv ? '' : '</div>');