Cleaning useless code.
This commit is contained in:
parent
5955c0ece0
commit
f6f04c69e0
@ -233,30 +233,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
|
// 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
|
// Retrieve data
|
||||||
|
Loading…
Reference in New Issue
Block a user