Cleaning useless code.

This commit is contained in:
Antonin 2015-10-28 15:08:54 +01:00
parent 6cc46b5bae
commit 22253b4e68
2 changed files with 0 additions and 47 deletions

View File

@ -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
// -------------------------------

View File

@ -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