mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 10:37:30 -07:00
Revert "Replaced some 'switch' with the 'match' expression (#1147)"
This reverts commit 4cea325b6c
.
This commit is contained in:
parent
4cea325b6c
commit
ed3e28827b
11 changed files with 176 additions and 77 deletions
|
@ -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'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue