Corrections following Olivier's comments

This commit is contained in:
Antonin 2016-05-04 11:12:59 +02:00
parent b739683d96
commit 5dead9e9e4

View File

@ -138,15 +138,18 @@ $warnings = 0;
foreach ($messages as $message) { foreach ($messages as $message) {
if ($message->type == 'danger') { if ($message->type == 'danger') {
$errors++; $errors++;
} else if ($message->type == 'warning') } else if ($message->type == 'warning') {
$warnings++; $warnings++;
} }
}
$readyPercentage = round((count($messages)-$errors)*100/count($messages)); $readyPercentage = round((count($messages)-$errors)*100/count($messages));
$readyClass = 'success';
if ($errors > 0) { if ($errors > 0) {
$readyClass = 'danger'; $readyClass = 'danger';
} else if ($warnings > 0) { } else if ($warnings > 0) {
$readyClass = 'warning'; $readyClass = 'warning';
} else {
$readyClass = 'success';
} }
usort($messages, 'compareCheckMessage'); usort($messages, 'compareCheckMessage');