protected function showNoticeListItem(NoticeListItem $nli)
 {
     $nli->showNotice();
     $nli->showNoticeAttachments();
     $nli->showNoticeInfo();
     $nli->showNoticeOptions();
     $nli->showNoticeLink();
     $nli->showNoticeSource();
     $nli->showNoticeLocation();
     $nli->showPermalink();
     $nli->showNoticeOptions();
 }
Exemplo n.º 2
0
 /**
  * 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(NoticeListItem $nli)
 {
     if (!$this->isMyNotice($nli->notice)) {
         return true;
     }
     $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', 'value' => _m('Your answer...')));
                 $out->elementEnd('li');
                 $out->elementEnd('ul');
             }
         }
     }
     return false;
 }
Exemplo n.º 3
0
 function showNoticePollResponse($notice, $out)
 {
     $user = common_current_user();
     // @hack we want regular rendering, then just add stuff after that
     $nli = new NoticeListItem($notice, $out);
     $nli->showNotice();
     // @fixme
     $out->elementStart('div', array('class' => 'entry-content'));
 }
Exemplo n.º 4
0
 function showNoticeAnswer($notice, $out)
 {
     $user = common_current_user();
     $answer = QnA_Answer::getByNotice($notice);
     $question = $answer->getQuestion();
     $nli = new NoticeListItem($notice, $out);
     $nli->showNotice();
     $out->elementStart('div', array('class' => 'entry-content answer-content'));
     if (!empty($answer)) {
         $form = new QnashowanswerForm($out, $answer);
         $form->show();
     } else {
         // TRANS: Error message displayed when answer data is not present.
         $out->text(_m('Answer data is missing.'));
     }
     $out->elementEnd('div');
     // @todo FIXME
     $out->elementStart('div', array('class' => 'entry-content'));
 }