diff --git a/fragments/addons/poll/option.php b/fragments/addons/poll/option.php deleted file mode 100644 index 1c20f29..0000000 --- a/fragments/addons/poll/option.php +++ /dev/null @@ -1,3 +0,0 @@ -option->title . '=' . $this->option->getId(); diff --git a/lib/poll.php b/lib/poll.php index c8103cf..37f58cf 100755 --- a/lib/poll.php +++ b/lib/poll.php @@ -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')) { @@ -168,7 +167,7 @@ public function getFormByType() hidden|poll-id|' . $this->getId() . ' html|poll-question|

' . $this->description . '

- radio|poll-option||' . implode(',', $options) . ' + choice|poll-option||' . $options . '|1|0|||||||||0| validate|empty|poll-option|{{ poll_validate_option }} @@ -187,7 +186,7 @@ public function getFormByType() html|poll-question|

' . $this->description . '

- radio|poll-option||' . implode(',', $options) . ' + choice|poll-option||' . $options . '|1|0|||||||||0| html|email_note|

{{ poll_email_note }}

text|poll-email|{{ poll_email_label }} @@ -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 @@ -211,7 +210,7 @@ public function getFormByType() hidden|poll-id|' . $this->getId() . ' html|poll-question|

' . $this->description . '

- radio|poll-option||' . implode(',', $options) . ' + choice|poll-option||' . $options . '|1|0|||||||||0| validate|empty|poll-option|{{ poll_validate_option }}