Skip to content

Commit

Permalink
Optionen auf choice und json umgestellt, damit auch Kommata im Text f…
Browse files Browse the repository at this point in the history
…unzen.

Datenschutz-Checkbox korrigiert
  • Loading branch information
tyrant88 committed Jun 10, 2020
1 parent f34b1d9 commit 58be90c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
3 changes: 0 additions & 3 deletions fragments/addons/poll/option.php

This file was deleted.

13 changes: 6 additions & 7 deletions lib/poll.php
Expand Up @@ -151,10 +151,9 @@ public function getFormByType()
{
$options = [];
foreach ($this->getRelatedCollection('options') as $option) {
$fragment = new rex_fragment();
$fragment->setVar('option', $option);
$options[] = $fragment->parse('addons/poll/option.php');
$options[$option->title] = $option->getId();
}
$options = json_encode($options);

$comment = '';
if (1 == $this->getValue('comment')) {
Expand All @@ -168,7 +167,7 @@ public function getFormByType()
hidden|poll-id|' . $this->getId() . '
html|poll-question|<h2>' . $this->description . '</h2>
radio|poll-option||' . implode(',', $options) . '
choice|poll-option||' . $options . '|1|0|||||||||0|
validate|empty|poll-option|{{ poll_validate_option }}
Expand All @@ -187,7 +186,7 @@ public function getFormByType()
html|poll-question|<h2>' . $this->description . '</h2>
radio|poll-option||' . implode(',', $options) . '
choice|poll-option||' . $options . '|1|0|||||||||0|
html|email_note|<p>{{ poll_email_note }}</p>
text|poll-email|{{ poll_email_label }}
Expand All @@ -198,7 +197,7 @@ public function getFormByType()
' . $comment . '
checkbox|ds|{{ poll_datenschutz_checkbox }}|0,1|0|no_db
checkbox|ds|{{ poll_datenschutz_checkbox }}|0|no_db
validate|empty|ds|{{ poll_datenschutz_checkbox_error }}
action|poll_executevote|poll-id|poll-option|poll-email|' . $this->getValue('emailtemplate') . '|poll-comment
Expand All @@ -211,7 +210,7 @@ public function getFormByType()
hidden|poll-id|' . $this->getId() . '
html|poll-question|<h2>' . $this->description . '</h2>
radio|poll-option||' . implode(',', $options) . '
choice|poll-option||' . $options . '|1|0|||||||||0|
validate|empty|poll-option|{{ poll_validate_option }}
Expand Down

0 comments on commit 58be90c

Please sign in to comment.