mirror of
https://framagit.org/framasoft/framadate/framadate
synced 2026-07-28 12:04:23 +00:00
Hidden results option is taken into account.
- Also added possibility for the poll's maker to edit this hidden results option.
This commit is contained in:
parent
0c2ba20bfa
commit
a135f74383
12 changed files with 166 additions and 100 deletions
|
|
@ -70,7 +70,7 @@ if (!$poll) {
|
|||
|
||||
if (isset($_POST['update_poll_info'])) {
|
||||
$updated = false;
|
||||
$field = $inputService->filterAllowedValues($_POST['update_poll_info'], ['title', 'admin_mail', 'description', 'rules', 'expiration_date', 'name']);
|
||||
$field = $inputService->filterAllowedValues($_POST['update_poll_info'], ['title', 'admin_mail', 'description', 'rules', 'expiration_date', 'name', 'hidden']);
|
||||
|
||||
// Update the right poll field
|
||||
if ($field == 'title') {
|
||||
|
|
@ -128,6 +128,13 @@ if (isset($_POST['update_poll_info'])) {
|
|||
$poll->admin_name = $admin_name;
|
||||
$updated = true;
|
||||
}
|
||||
} elseif ($field == 'hidden') {
|
||||
$hidden = filter_input(INPUT_POST, 'hidden', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => BOOLEAN_REGEX]]);
|
||||
$hidden = $hidden==null?false:true;
|
||||
if ($hidden != $poll->hidden) {
|
||||
$poll->hidden = $hidden;
|
||||
$updated = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Update poll in database
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue