Display a confirmation page before delete the poll (confirmation does nothing for now)
This commit is contained in:
parent
07d5a336fb
commit
3829402a69
@ -136,6 +136,21 @@ if (!empty($_POST['delete_comment'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------
|
||||||
|
// Delete the entire poll
|
||||||
|
// -------------------------------
|
||||||
|
|
||||||
|
if (isset($_POST['delete_poll'])) {
|
||||||
|
$smarty->assign('poll_id', $poll_id);
|
||||||
|
$smarty->assign('admin_poll_id', $admin_poll_id);
|
||||||
|
$smarty->display('confirm/delete_poll.tpl');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
if (isset($_POST['confirm_delete_poll'])) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
// Retrieve data
|
// Retrieve data
|
||||||
$slots = $pollService->allSlotsByPollId($poll_id);
|
$slots = $pollService->allSlotsByPollId($poll_id);
|
||||||
$votes = $pollService->allUserVotesByPollId($poll_id);
|
$votes = $pollService->allUserVotesByPollId($poll_id);
|
||||||
|
11
tpl/confirm/delete_poll.tpl
Normal file
11
tpl/confirm/delete_poll.tpl
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{extends file='page.tpl'}
|
||||||
|
|
||||||
|
{block name=main}
|
||||||
|
<form action="{$admin_poll_id|poll_url:true}" method="POST">
|
||||||
|
<div class="alert alert-danger text-center">
|
||||||
|
<h2>{_("Confirm removal of your poll")}</h2>
|
||||||
|
<p><button class="btn btn-default" type="submit" name="cancel">{_("Keep this poll")}</button>
|
||||||
|
<button type="submit" name="confirm_delete_poll" class="btn btn-danger">{_("Remove this poll!")}</button></p>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
{/block}
|
Loading…
Reference in New Issue
Block a user