QnA - add best class to best answers
This commit is contained in:
parent
bac112c244
commit
960aebdbc4
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user