1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 19:41:55 +02:00

Fix the debug_result convenience function

The point of a convenience function is to be convenient, not to have an
unused first parameter and always be surrounded by the same boilerplate.
This commit is contained in:
Paul Arthur 2013-02-03 04:54:37 -05:00
parent 10d54c9f7f
commit c8cd1da88f
4 changed files with 57 additions and 148 deletions

View file

@ -279,19 +279,18 @@ function escape_ini($str) {
/**
* debug_ok
* Return an "OK" with the specified string
* debug_result
*
* Convenience function to format the output.
*/
function debug_result($comment,$status=false,$value=false) {
function debug_result($status = false, $value = null, $comment = '') {
$class = $status ? 'ok' : 'notok';
if (!$value) {
$value = $status ? 'OK' : 'ERROR';
}
$final = '<span class="' . $class . '">' . scrub_out($value) . '</span> <em>' . $comment . '</em>';
return $final;
} // debug_ok
return '[ <span class="' . $class . '">' . scrub_out($value) .
'</span> <em>' . $comment . '</em> ]';
}
?>