function countAnswers()
{
- $a = new QnA_Answer();
+ $a = new QnA_Answer();
+
$a->question_id = $this->id;
- return $a-count();
+
+ return $a->count();
}
static function fromNotice($notice)
$out->elementEnd('span');
}
+ $cnt = $question->countAnswers();
+
+ if (!empty($cnt)) {
+ $out->elementStart('span', 'answer-count');
+ $out->text(sprintf(_m('%s answers'), $cnt));
+ $out->elementEnd('span');
+ }
+
if (!empty($question->closed)) {
$out->elementStart('span', 'question-closed');
$out->text(_m('This question is closed.'));
function formActions()
{
// TRANS: Button text for submitting a poll response.
- $this->out->submit('submit', _m('BUTTON', 'Submit'));
+ $this->out->submit('submit', _m('BUTTON', 'Answer'));
}
}
{
parent::__construct($out);
- $this->answer = $answer;
- $this->question = $answer->getQuestion();
+ $this->answer = $answer;
+ $this->question = $answer->getQuestion();
}
/**
}
}
+
+ /*
+ * @fixme: Revise is disabled until we figure out the
+ * Ostatus bits This comment is just a reminder
+ * that the UI for this works.
+ */
+ /*
if ($user->id == $this->answer->profile_id) {
$this->out->submit(
'revise',
_('Revise your answer')
);
}
+ */
}
}
'question-' . $this->question->id
);
- $this->out->raw($this->question->asHTML());
+ $this->out->raw($this->question->asHTML());
}
/**