From: Zach Copley Date: Mon, 4 Apr 2011 22:28:28 +0000 (-0700) Subject: QnA - Don't output question-description if it's empty; Do output question-closed... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=53c653038d4127626ab4506d578a80804ed65439;p=quix0rs-gnu-social.git QnA - Don't output question-description if it's empty; Do output question-closed msg if question is closed --- diff --git a/plugins/QnA/classes/QnA_Question.php b/plugins/QnA/classes/QnA_Question.php index 3f1a33d33c..ed1757e989 100644 --- a/plugins/QnA/classes/QnA_Question.php +++ b/plugins/QnA/classes/QnA_Question.php @@ -214,9 +214,18 @@ class QnA_Question extends Managed_DataObject $notice = $question->getNotice(); $out = new XMLStringer(); - $out->elementStart('span', 'question_description'); - $out->raw(QnAPlugin::shorten($question->description, $notice)); - $out->elementEnd('span'); + + if (!empty($question->description)) { + $out->elementStart('span', 'question-description'); + $out->raw(QnAPlugin::shorten($question->description, $notice)); + $out->elementEnd('span'); + } + + if (!empty($question->closed)) { + $out->elementStart('span', 'question-closed'); + $out->text(_m('This question is closed.')); + $out->elementEnd('span'); + } return $out->getString(); }