mirror of
https://framagit.org/framasoft/framadate/framadate
synced 2026-07-18 00:55:03 +00:00
admin: Add availability to delete comments one by one.
This commit is contained in:
parent
178208380f
commit
1b01bcc6b6
4 changed files with 59 additions and 32 deletions
|
|
@ -55,6 +55,7 @@ if (!$poll) {
|
|||
// -------------------------------
|
||||
// Update poll info
|
||||
// -------------------------------
|
||||
|
||||
if (isset($_POST['update_poll_info'])) {
|
||||
$updated = false;
|
||||
$field = $inputService->filterAllowedValues($_POST['update_poll_info'], ['title', 'admin_mail', 'comment', 'rules']);
|
||||
|
|
@ -107,6 +108,19 @@ if (isset($_POST['update_poll_info'])) {
|
|||
}
|
||||
}
|
||||
|
||||
// -------------------------------
|
||||
// Delete a comment
|
||||
// -------------------------------
|
||||
if (!empty($_POST['delete_comment'])) {
|
||||
$comment_id = filter_input(INPUT_POST, 'delete_comment', FILTER_VALIDATE_INT);
|
||||
|
||||
if ($pollService->deleteComment($poll_id, $comment_id)) {
|
||||
$message = new Message('success', _('Comment deleted.'));
|
||||
} else {
|
||||
$message = new Message('danger', _('Failed to delete the comment.'));
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieve data
|
||||
$slots = $pollService->allSlotsByPollId($poll_id);
|
||||
$votes = $pollService->allUserVotesByPollId($poll_id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue