Cleaning useless code.
This commit is contained in:
parent
6cc46b5bae
commit
22253b4e68
@ -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
|
||||
// -------------------------------
|
||||
|
23
studs.php
23
studs.php
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user