QnA - Allow answer revisions and marking a question as "best"

This commit is contained in:
Zach Copley
2011-04-04 01:27:38 -07:00
parent 960aebdbc4
commit 528d999ae7
6 changed files with 315 additions and 36 deletions

View File

@@ -140,7 +140,7 @@ class QnA_Answer extends Managed_DataObject
{
$answer = self::staticGet('uri', $notice->uri);
if (empty($answer)) {
throw new Exception("No answer with URI {$this->notice->uri}");
throw new Exception("No answer with URI {$notice->uri}");
}
return $answer;
}
@@ -205,7 +205,14 @@ class QnA_Answer extends Managed_DataObject
{
$notice = $question->getNotice();
$fmt = '<p class="qna_answer">';
$fmt = '';
if (!empty($answer->best)) {
$fmt = '<p class="qna_answer best">';
} else {
$fmt = '<p class="qna_answer">';
}
$fmt .= '<span class="answer_author"><a href="%1$s">answer</a> by <a href="%2$s">%3$s</a></span>';
$fmt .= '<span class="answer_content">%4$s</span>';
if (!empty($answer->revisions)) {