]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add toselector to poll
authorEvan Prodromou <evan@status.net>
Tue, 5 Apr 2011 15:18:35 +0000 (11:18 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 5 Apr 2011 15:18:35 +0000 (11:18 -0400)
plugins/Poll/newpoll.php
plugins/Poll/newpollform.php

index 1048b0a1edd930d87b89cb4a99d600993b56bda1..e7d5d3dd0d6d32484d7b9cb9e4f83cada24bb1c0 100644 (file)
@@ -138,10 +138,19 @@ class NewPollAction extends Action
                 throw new ClientException(_m('Poll must have at least two options.'));
             }
 
+            // Notice options; distinct from choices for the poll
+
+            $options = array();
+
+            // Does the heavy-lifting for getting "To:" information
+
+            ToSelector::fillOptions($this, $options);
 
             $saved = Poll::saveNew($this->user->getProfile(),
-                                              $this->question,
-                                              $this->options);
+                                   $this->question,
+                                   $this->options,
+                                   $options);
+
         } catch (ClientException $ce) {
             $this->error = $ce->getMessage();
             $this->showPage();
index 295619b1b9ea3bf2366da66195b9aa79eda9d195..37d7bc149c6455ec561a9c9fd5c50d25f2bc7a96 100644 (file)
@@ -131,6 +131,12 @@ class NewpollForm extends Form
         }
 
         $this->out->elementEnd('ul');
+
+        $toWidget = new ToSelector($this->out,
+                                   common_current_user(),
+                                   null);
+        $toWidget->show();
+
         $this->out->elementEnd('fieldset');
     }