Skip to content
Snippets Groups Projects
Commit 22253b4e authored by Antonin's avatar Antonin
Browse files

Cleaning useless code.

parent 6cc46b5b
No related branches found
No related tags found
No related merge requests found
......@@ -234,30 +234,6 @@ if (isset($_POST['confirm_remove_all_votes'])) {
}
}
// -------------------------------
// Add a comment
// -------------------------------
if (isset($_POST['add_comment'])) {
$name = $inputService->filterName($_POST['name']);
$comment = $inputService->filterComment($_POST['comment']);
if ($name == null) {
$message = new Message('danger', __('Error', 'The name is invalid.'));
}
if ($message == null) {
// Add comment
$result = $pollService->addComment($poll_id, $name, $comment);
if ($result) {
$message = new Message('success', __('Comments', 'Comment added'));
} else {
$message = new Message('danger', __('Error', 'Comment failed'));
}
}
}
// -------------------------------
// Delete a comment
// -------------------------------
......
......@@ -128,29 +128,6 @@ if (!empty($_POST['save'])) { // Save edition of an old vote
}
}
}
// -------------------------------
// Add a comment
// -------------------------------
if (isset($_POST['add_comment'])) {
$name = $inputService->filterName($_POST['name']);
$comment = $inputService->filterComment($_POST['comment']);
if ($name == null) {
$message = new Message('danger', __('Error', 'The name is invalid.'));
}
if ($message == null) {
// Add comment
$result = $pollService->addComment($poll_id, $name, $comment);
if ($result) {
$message = new Message('success', __('Comments', 'Comment added'));
$notificationService->sendUpdateNotification($poll, NotificationService::ADD_COMMENT, $name);
} else {
$message = new Message('danger', __('Error', 'Comment failed'));
}
}
}
// Retrieve data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment