QnA - Better display of questions and answers in streams

This commit is contained in:
Zach Copley
2011-04-03 16:57:59 -07:00
parent 8e086d5a90
commit bac112c244
2 changed files with 85 additions and 14 deletions

View File

@@ -137,9 +137,11 @@ class QnanewanswerAction extends Action
*/
function newAnswer()
{
$profile = $this->user->getProfile();
try {
$notice = QnA_Answer::saveNew(
$this->user->getProfile(),
$profile,
$this->question,
$this->answerText
);
@@ -150,6 +152,7 @@ class QnanewanswerAction extends Action
}
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');
@@ -158,7 +161,7 @@ class QnanewanswerAction extends Action
$this->element('title', null, _m('Answers'));
$this->elementEnd('head');
$this->elementStart('body');
$this->raw($this->answer->asHTML());
$this->raw($answer->asHTML());
$this->elementEnd('body');
$this->elementEnd('html');
} else {