QnA: Unify answer forms

This commit is contained in:
Zach Copley 2011-04-04 12:02:33 -07:00
parent c4b9dc7a0f
commit e6fd3fa038
3 changed files with 6 additions and 8 deletions

View File

@ -391,7 +391,7 @@ class QnAPlugin extends MicroAppPlugin
// Don't prompt user for an answer if the question is closed or
// the current user posed the question in the first place
if (empty($question->closed)) {
if (!empty($user) && ($user->id != $question->profile_id)) {
if (!empty($user)) {
$profile = $user->getProfile();
$answer = $question->getAnswer($profile);
if (!$answer) {

View File

@ -103,9 +103,9 @@ class QnanewanswerForm extends Form
$out = $this->out;
$id = "question-" . $question->id;
$out->element('p', 'answer', $question->title);
$out->element('p', 'answer', 'Your answer');
$out->hidden('id', $id);
$out->element('input', array('type' => 'text', 'name' => 'answer'));
$out->textarea('answer', 'answer');
}
/**

View File

@ -102,12 +102,10 @@ class QnareviseanswerForm extends Form
function formData()
{
$out = $this->out;
$out->element('p', 'Your answer to:', $this->question->title);
$out->element('p', 'revise-answer', 'Your answer');
$id = "answer-" . $this->answer->id;
$out->hidden('id', $id);
$out->textarea('answer', 'You said:', $this->answer->content);
$out->textarea('answer', 'answer', $this->answer->content);
}
/**