]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
QnA - Don't output question-description if it's empty; Do output question-closed...
authorZach Copley <zach@status.net>
Mon, 4 Apr 2011 22:28:28 +0000 (15:28 -0700)
committerZach Copley <zach@status.net>
Mon, 4 Apr 2011 22:28:28 +0000 (15:28 -0700)
plugins/QnA/classes/QnA_Question.php

index 3f1a33d33cc3c95acaa64e68fb376b6e35fd4d3c..ed1757e9892e5c9021a3881f9451dbde9b1fdc6a 100644 (file)
@@ -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();
     }