QnA - Better ajax response when making a new answer. Still not right. Needs to use threading.

This commit is contained in:
Zach Copley 2011-04-05 00:27:51 -07:00
parent 6c0bb0f35b
commit 5267f3d649
2 changed files with 28 additions and 4 deletions

View File

@ -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 {

View File

@ -125,9 +125,7 @@ class QnashowanswerForm extends Form
'answer-' . $this->answer->id
);
// $this->out->raw($this->answer->asHTML());
$this->out->raw($this->answer->asHTML());
}
/**