From: Zach Copley Date: Tue, 5 Apr 2011 16:12:54 +0000 (-0700) Subject: QnA - Add ToSelector to new question X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6954cb35082737f3da87f3b8eadab8e91d1e6d4c;p=quix0rs-gnu-social.git QnA - Add ToSelector to new question --- diff --git a/plugins/QnA/actions/qnanewquestion.php b/plugins/QnA/actions/qnanewquestion.php index 561b11575a..3399c5eda8 100644 --- a/plugins/QnA/actions/qnanewquestion.php +++ b/plugins/QnA/actions/qnanewquestion.php @@ -130,10 +130,17 @@ class QnanewquestionAction extends Action throw new ClientException(_m('Question must have a title.')); } + // Notice options + $options = array(); + + // Does the heavy-lifting for getting "To:" information + ToSelector::fillOptions($this, $options); + $saved = QnA_Question::saveNew( $this->user->getProfile(), $this->title, - $this->description + $this->description, + $options ); } catch (ClientException $ce) { $this->error = $ce->getMessage(); diff --git a/plugins/QnA/lib/qnanewquestionform.php b/plugins/QnA/lib/qnanewquestionform.php index 114e6199a1..1def13a8c4 100644 --- a/plugins/QnA/lib/qnanewquestionform.php +++ b/plugins/QnA/lib/qnanewquestionform.php @@ -121,6 +121,12 @@ class QnanewquestionForm extends Form $this->unli(); $this->out->elementEnd('ul'); + $toWidget = new ToSelector( + $this->out, + common_current_user(), + null + ); + $toWidget->show(); $this->out->elementEnd('fieldset'); }