*/
class QnanewanswerAction extends Action
{
- protected $user = null;
- protected $error = null;
- protected $complete = null;
+ protected $user = null;
+ protected $error = null;
+ protected $complete = null;
- protected $question = null;
- protected $answerText = null;
+ protected $question = null;
+ protected $content = null;
/**
* Returns the title of the action
$this->checkSessionToken();
}
- $id = $this->trimmed('id');
+ $id = substr($this->trimmed('id'), 9);
+
+ common_debug("XXXXXXXXXXXXXXXXXX id = " . $id);
+
$this->question = QnA_Question::staticGet('id', $id);
-
+
if (empty($this->question)) {
// TRANS: Client exception thrown trying to respond to a non-existing question.
throw new ClientException(
- _m('Invalid or missing question.'),
+ _m('Invalid or missing question.'),
404
);
}
$this->answerText = $this->trimmed('answer');
-
+
return true;
}
$this->showPage();
return;
}
-
if ($this->boolean('ajax')) {
+ common_debug("ajaxy part");
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');
- $form = new QnA_Answer($this->question, $this);
- $form->show();
+ $this->raw()
$this->elementEnd('body');
$this->elementEnd('html');
} else {
}
$form = new QnaanswerForm($this->question, $this);
-
$form->show();
return;