From: Zach Copley Date: Tue, 5 Apr 2011 07:27:51 +0000 (-0700) Subject: QnA - Better ajax response when making a new answer. Still not right. Needs to use... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5267f3d649de302e7b2f9fcb252dd10a1b7537bb;p=quix0rs-gnu-social.git QnA - Better ajax response when making a new answer. Still not right. Needs to use threading. --- diff --git a/plugins/QnA/actions/qnanewanswer.php b/plugins/QnA/actions/qnanewanswer.php index 94bfc09a39..0c4938e6a9 100644 --- a/plugins/QnA/actions/qnanewanswer.php +++ b/plugins/QnA/actions/qnanewanswer.php @@ -155,13 +155,39 @@ class QnanewanswerAction extends Action $answer = $this->question->getAnswer($profile); header('Content-Type: text/xml;charset=utf-8'); $this->xw->startDocument('1.0', 'UTF-8'); + $this->elementStart('html'); $this->elementStart('head'); // TRANS: Page title after sending an answer. $this->element('title', null, _m('Answers')); $this->elementEnd('head'); + $this->elementStart('body'); - $this->raw($answer->asHTML()); + + $nli = new NoticeListItem($notice, $this); + $nli->show(); + //$this->raw($answer->asHTML()); + + /* + $question = $this->question; + + $nli = new NoticeListItem($notice, $this); + $nli->showNotice(); + + $this->elementStart('div', array('class' => 'entry-content answer-content')); + + if (!empty($answer)) { + $form = new QnashowanswerForm($this, $answer); + $form->show(); + } else { + $this->text(_m('Answer data is missing.')); + } + + $this->elementEnd('div'); + + // @fixme + //$this->elementStart('div', array('class' => 'entry-content')); + */ $this->elementEnd('body'); $this->elementEnd('html'); } else { diff --git a/plugins/QnA/lib/qnashowanswerform.php b/plugins/QnA/lib/qnashowanswerform.php index 665c40857f..f3923698d2 100644 --- a/plugins/QnA/lib/qnashowanswerform.php +++ b/plugins/QnA/lib/qnashowanswerform.php @@ -125,9 +125,7 @@ class QnashowanswerForm extends Form 'answer-' . $this->answer->id ); - - - // $this->out->raw($this->answer->asHTML()); + $this->out->raw($this->answer->asHTML()); } /**