mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Don't requires fill textarea for mod comment deleting (#1433)
* Don't requires fill textarea for mod comment deleting * Update CHANGELOG.md
This commit is contained in:
parent
2898887806
commit
1f08637a1f
2 changed files with 9 additions and 18 deletions
|
@ -16,7 +16,7 @@ global $lang, $userdata;
|
|||
$post_id = (int)$this->request['post_id'];
|
||||
$mc_type = (int)$this->request['mc_type'];
|
||||
$mc_text = (string)$this->request['mc_text'];
|
||||
if (!$mc_text = prepare_message($mc_text)) {
|
||||
if ($mc_type != 0 && !$mc_text = prepare_message($mc_text)) {
|
||||
$this->ajax_die($lang['EMPTY_MESSAGE']);
|
||||
}
|
||||
|
||||
|
@ -46,23 +46,13 @@ if ($mc_type && $post['poster_id'] != $userdata['user_id']) {
|
|||
\TorrentPier\Sessions::cache_rm_user_sessions($post['poster_id']);
|
||||
}
|
||||
|
||||
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_class = match ($mc_type) {
|
||||
1 => 'success',
|
||||
2 => 'info',
|
||||
3 => 'warning',
|
||||
4 => 'danger',
|
||||
default => '',
|
||||
};
|
||||
|
||||
$this->response['mc_type'] = $mc_type;
|
||||
$this->response['post_id'] = $post_id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue