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)
|
function onStartOpenNoticeListItemElement($nli)
|
||||||
{
|
{
|
||||||
|
|
||||||
$type = $nli->notice->object_type;
|
$type = $nli->notice->object_type;
|
||||||
|
|
||||||
switch($type)
|
switch($type)
|
||||||
@ -318,9 +317,18 @@ class QnAPlugin extends MicroAppPlugin
|
|||||||
break;
|
break;
|
||||||
case QnA_Answer::OBJECT_TYPE:
|
case QnA_Answer::OBJECT_TYPE:
|
||||||
$id = (empty($nli->repeat)) ? $nli->notice->id : $nli->repeat->id;
|
$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(
|
$nli->out->elementStart(
|
||||||
'li', array(
|
'li', array(
|
||||||
'class' => 'hentry notice answer',
|
'class' => implode(' ', $classes),
|
||||||
'id' => 'notice-' . $id
|
'id' => 'notice-' . $id
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -367,8 +375,6 @@ class QnAPlugin extends MicroAppPlugin
|
|||||||
$nli = new NoticeListItem($notice, $out);
|
$nli = new NoticeListItem($notice, $out);
|
||||||
$nli->showNotice();
|
$nli->showNotice();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$out->elementStart('div', array('class' => 'entry-content question-desciption'));
|
$out->elementStart('div', array('class' => 'entry-content question-desciption'));
|
||||||
|
|
||||||
$question = QnA_Question::getByNotice($notice);
|
$question = QnA_Question::getByNotice($notice);
|
||||||
|
Loading…
Reference in New Issue
Block a user