* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- * @category QuestonAndAnswer
+ * @category QnA
* @package StatusNet
* @author Zach Copley <zach@status.net>
* @copyright 2011 StatusNet, Inc.
*/
function newAnswer()
{
+ $profile = $this->user->getProfile();
+
try {
$notice = QnA_Answer::saveNew(
- $this->user->getProfile(),
+ $profile,
$this->question,
$this->answerText
);
}
if ($this->boolean('ajax')) {
common_debug("ajaxy part");
+ $answer = $this->question->getAnswer($profile);
header('Content-Type: text/xml;charset=utf-8');
$this->xw->startDocument('1.0', 'UTF-8');
$this->elementStart('html');
$this->element('title', null, _m('Answers'));
$this->elementEnd('head');
$this->elementStart('body');
- $this->raw()
+ $this->raw($answer->asHTML());
$this->elementEnd('body');
$this->elementEnd('html');
} else {
$this->element('p', 'error', $this->error);
}
- $form = new QnaanswerForm($this->question, $this);
+ $form = new QnanewanswerForm($this->question, $this);
$form->show();
return;