Revert "Replaced some 'switch' with the 'match' expression (#1147)"

This reverts commit 4cea325b6c.
This commit is contained in:
Roman Kelesidis 2023-11-21 09:37:05 +07:00
commit ed3e28827b
11 changed files with 176 additions and 77 deletions

View file

@ -666,13 +666,23 @@ for ($i = 0; $i < $total_posts; $i++) {
$pg_row_class = !($i % 2) ? 'row2' : 'row1';
// Mod comment
$mc_class = match ($mc_type) {
1 => 'success',
2 => 'info',
3 => 'warning',
4 => 'danger',
default => '',
};
switch ($mc_type) {
case 1: // Комментарий
$mc_class = 'success';
break;
case 2: // Информация
$mc_class = 'info';
break;
case 3: // Предупреждение
$mc_class = 'warning';
break;
case 4: // Нарушение
$mc_class = 'danger';
break;
default:
$mc_class = '';
break;
}
$mc_select_type = [];
foreach ($lang['MC_COMMENT'] as $key => $value) {
$mc_select_type[$key] = $value['type'];