- $out->elementStart('div', array('class' => 'entry-content question-desciption'));
-
- $question = QnA_Question::getByNotice($notice);
-
- if (!empty($question)) {
-
- $short = $this->shorten($question->description, $notice);
- $out->raw($short);
-
- // Don't prompt user for an answer if the question is closed or
- // the current user posed the question in the first place
- if (empty($question->closed)) {
- if (!empty($user) && ($user->id != $question->profile_id)) {
- $profile = $user->getProfile();
- $answer = $question->getAnswer($profile);
- if (!$answer) {
- $form = new QnanewanswerForm($question, $out);
- $form->show();
- }
+ $out = $nli->out;
+ $notice = $nli->notice;
+
+ $nli->showNotice($notice, $out);
+
+ $nli->showNoticeLink();
+ $nli->showNoticeSource();
+ $nli->showNoticeLocation();
+ $nli->showPermalink();
+
+ $nli->showNoticeOptions();
+
+ if ($notice->object_type == QnA_Question::OBJECT_TYPE) {
+ $user = common_current_user();
+ $question = QnA_Question::getByNotice($notice);
+
+ if (!empty($user) and !empty($question)) {
+ $profile = $user->getProfile();
+ $answer = $question->getAnswer($profile);
+
+ // Output a placeholder input -- clicking on it will
+ // bring up a real answer form
+
+ // NOTE: this whole ul is just a placeholder
+ if (empty($question->closed) && empty($answer)) {
+ $out->elementStart('ul', 'notices qna-dummy');
+ $out->elementStart('li', 'qna-dummy-placeholder');
+ $out->element(
+ 'input',
+ array(
+ 'class' => 'placeholder',
+ // TRANS: Placeholder value for a possible answer to a question
+ // TRANS: by the logged in user.
+ 'value' => _m('Your answer...')
+ )
+ );
+ $out->elementEnd('li');
+ $out->elementEnd('ul');