+ /**
+ * Output the HTML for this kind of object in a list
+ *
+ * @param NoticeListItem $nli The list item being shown.
+ *
+ * @return boolean hook value
+ *
+ * @todo FIXME: WARNING WARNING WARNING this closes a 'div' that is implicitly opened in BookmarkPlugin's showNotice implementation
+ */
+ function onStartShowNoticeItem($nli)
+ {
+ if (!$this->isMyNotice($nli->notice)) {
+ return true;
+ }
+
+ $out = $nli->out;
+ $notice = $nli->notice;
+
+ $this->showNotice($notice, $out);
+
+ $nli->showNoticeLink();
+ $nli->showNoticeSource();
+ $nli->showNoticeLocation();
+ $nli->showContext();
+ $nli->showRepeat();
+
+ $out->elementEnd('div');
+
+ $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');
+ }
+ }
+ }
+
+ return false;
+ }
+
+ function showNoticeAnswer(Notice $notice, $out)