QnA - add best class to best answers

This commit is contained in:
Zach Copley 2011-04-03 17:25:44 -07:00
parent bac112c244
commit 960aebdbc4

View File

@ -300,7 +300,6 @@ class QnAPlugin extends MicroAppPlugin
function onStartOpenNoticeListItemElement($nli)
{
$type = $nli->notice->object_type;
switch($type)
@ -318,9 +317,18 @@ class QnAPlugin extends MicroAppPlugin
break;
case QnA_Answer::OBJECT_TYPE:
$id = (empty($nli->repeat)) ? $nli->notice->id : $nli->repeat->id;
$classes = array('hentry', 'notice', 'answer');
$answer = QnA_Answer::staticGet('uri', $notice->uri);
if (!empty($answer) && (boolean($answer->best))) {
$classes[] = 'best';
}
$nli->out->elementStart(
'li', array(
'class' => 'hentry notice answer',
'class' => implode(' ', $classes),
'id' => 'notice-' . $id
)
);
@ -367,8 +375,6 @@ class QnAPlugin extends MicroAppPlugin
$nli = new NoticeListItem($notice, $out);
$nli->showNotice();
$out->elementStart('div', array('class' => 'entry-content question-desciption'));
$question = QnA_Question::getByNotice($notice);