* Some bug fixes
* Better Question page
This commit is contained in:
Zach Copley
2011-04-04 23:58:35 -07:00
parent cd7ab56874
commit 6c0bb0f35b
4 changed files with 70 additions and 16 deletions

View File

@@ -47,6 +47,7 @@ if (!defined('STATUSNET')) {
class QnanewanswerForm extends Form
{
protected $question;
protected $showQuestion;
/**
* Construct a new answer form
@@ -56,10 +57,11 @@ class QnanewanswerForm extends Form
*
* @return void
*/
function __construct(HTMLOutputter $out, QnA_Question $question)
function __construct(HTMLOutputter $out, QnA_Question $question, $showQuestion = true)
{
parent::__construct($out);
$this->question = $question;
$this->showQuestion = $showQuestion;
}
/**
@@ -103,9 +105,10 @@ class QnanewanswerForm extends Form
$out = $this->out;
$id = "question-" . $question->id;
$out->raw($this->question->asHTML());
if ($this->showQuestion) {
$out->raw($this->question->asHTML());
}
$out->element('p', 'answer', 'Your answer');
$out->hidden('id', $id);
$out->textarea('answer', 'answer');
}