Add function dol_htmloutput_mesg

This commit is contained in:
Laurent Destailleur 2011-01-30 17:15:51 +00:00
parent b09a960968
commit 3b0dd29f39

View File

@ -3448,13 +3448,14 @@ function monthArrayOrSelected($selected=0)
/** /**
* Returns formated errors messages * Returns formated messages (Used to show messages on html output)
* @param mesgstring Error message * @param mesgstring Message
* @param mesgarray Error messages array * @param mesgarray Messages array
* @param style Style of message output
* @return html Return html output * @return html Return html output
* @see dol_print_error * @see dol_print_error
*/ */
function dol_htmloutput_errors($mesgstring='',$mesgarray='') function dol_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok')
{ {
global $langs; global $langs;
@ -3463,7 +3464,7 @@ function dol_htmloutput_errors($mesgstring='',$mesgarray='')
if (is_array($mesgarray) && sizeof($mesgarray)) if (is_array($mesgarray) && sizeof($mesgarray))
{ {
print '<div class="error">'; print '<div class="'.$style.'">';
foreach($mesgarray as $message) foreach($mesgarray as $message)
{ {
$ret++; $ret++;
@ -3474,7 +3475,7 @@ function dol_htmloutput_errors($mesgstring='',$mesgarray='')
if ($mesgstring) if ($mesgstring)
{ {
$ret++; $ret++;
print '<div class="error">'; print '<div class="'.$style.'">';
print $langs->trans($mesgstring); print $langs->trans($mesgstring);
print '</div>'; print '</div>';
} }
@ -3482,9 +3483,20 @@ function dol_htmloutput_errors($mesgstring='',$mesgarray='')
return $ret; return $ret;
} }
/**
* Returns formated errors messages (Used to show errors on html output)
* @param mesgstring Error message
* @param mesgarray Error messages array
* @return html Return html output
* @see dol_print_error
*/
function dol_htmloutput_errors($mesgstring='',$mesgarray='')
{
return dol_htmloutput_mesg($mesgstring, $mesgarray, 'error');
}
/** /**
* \brief This function output memory used by PHP and exit everything. Used for debugging purpose. * This function output memory used by PHP and exit everything. Used for debugging purpose.
*/ */
function stopwithmem() function stopwithmem()
{ {