From: Evan Prodromou Date: Tue, 5 Apr 2011 15:18:35 +0000 (-0400) Subject: add toselector to poll X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9018a118fa84491921c7b1b9ec2d5915011ab77b;p=quix0rs-gnu-social.git add toselector to poll --- diff --git a/plugins/Poll/newpoll.php b/plugins/Poll/newpoll.php index 1048b0a1ed..e7d5d3dd0d 100644 --- a/plugins/Poll/newpoll.php +++ b/plugins/Poll/newpoll.php @@ -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(); diff --git a/plugins/Poll/newpollform.php b/plugins/Poll/newpollform.php index 295619b1b9..37d7bc149c 100644 --- a/plugins/Poll/newpollform.php +++ b/plugins/Poll/newpollform.php @@ -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'); }