/**
  * Print Posting.
  *
  */
 function printPost()
 {
     global $tpl, $lng, $ilAccess, $ilias;
     if (!$ilAccess->checkAccess('read,visible', '', $_GET['ref_id'])) {
         $ilias->raiseError($lng->txt('permission_denied'), $ilias->error_obj->MESSAGE);
     }
     $tplEx = new ilTemplate('tpl.forums_export_print.html', true, true, 'Modules/Forum');
     $tplEx->setVariable('CSSPATH', $tpl->tplPath);
     // get forum- and thread-data
     $this->frm->setMDB2WhereCondition('top_pk = %s ', array('integer'), array($_GET['top_pk']));
     if (is_array($frmData = $this->frm->getOneTopic())) {
         // post object
         $post = new ilForumPost((int) $_GET['print_post']);
         // headline
         $tplEx->setVariable('HEADLINE', $lng->txt('forum') . ': ' . $frmData['top_name'] . ' > ' . $lng->txt('forums_thread') . ': ' . $post->getThread()->getSubject());
         $tplEx->setCurrentBlock('posts_row');
         $tplEx->setVariable('ROWCOL', 'tblrow2');
         $authorinfo = new ilForumAuthorInformation($post->getUserId(), $post->getUserAlias(), $post->getImportName());
         $tplEx->setVariable('AUTHOR', $authorinfo->getAuthorName());
         if ($post->getUserId()) {
             // get create- and update-dates
             if ($post->getUpdateUserId()) {
                 $authorinfo = new ilForumAuthorInformation($post->getUpdateUserId(), '', '');
                 $tplEx->setVariable('POST_UPDATE', "<br />[" . $lng->txt('edited_on') . ": " . $this->frm->convertDate($post->getChangeDate()) . " - " . strtolower($lng->txt('from')) . " " . $authorinfo->getAuthorName() . "]");
             }
             if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id'])) {
                 $numPosts = $this->frm->countUserArticles($post->getUserId());
             } else {
                 $numPosts = $this->frm->countActiveUserArticles($post->getUserId());
             }
         }
         $tplEx->setVariable('SUBJECT', $post->getSubject());
         $tplEx->setVariable('TXT_CREATE_DATE', $lng->txt('forums_thread_create_date'));
         $tplEx->setVariable('POST_DATE', $this->frm->convertDate($post->getCreateDate()));
         $tplEx->setVariable('SPACER', "<hr noshade width=\"100%\" size=\"1\" align=\"center\" />");
         if ($post->isCensored()) {
             $tplEx->setVariable('POST', nl2br(stripslashes($post->getCensorshipComment())));
         } else {
             /** @todo mjansen: possible bugfix for mantis #8223 */
             if ($post->getMessage() == strip_tags($post->getMessage())) {
                 // We can be sure, that there are not html tags
                 $post->setMessage(nl2br($post->getMessage()));
             }
             $tplEx->setVariable('POST', ilRTE::_replaceMediaObjectImageSrc($this->frm->prepareText($post->getMessage(), 0, '', 'export'), 1));
         }
         $tplEx->parseCurrentBlock('posts_row');
         $tplEx->setCurrentBlock('posttable');
         $tplEx->setVariable('TXT_AUTHOR', $lng->txt('author'));
         $tplEx->setVariable('TXT_POST', $lng->txt('forums_thread') . ': ' . $post->getThread()->getSubject());
         $tplEx->parseCurrentBlock('posttable');
     }
     // if (is_array($frmData = $this->frm->getOneTopic()))
     $tplEx->show();
 }
 /**
  *
  */
 public function printPost()
 {
     /**
      * @var $tpl      ilTemplate
      * @var $lng      ilLanguage
      * @var $ilAccess ilAccessHandler
      * @var $ilias    ILIAS
      */
     global $tpl, $lng, $ilAccess, $ilias;
     if (!$ilAccess->checkAccess('read,visible', '', $_GET['ref_id'])) {
         $ilias->raiseError($lng->txt('permission_denied'), $ilias->error_obj->MESSAGE);
     }
     ilDatePresentation::setUseRelativeDates(false);
     $tpl = new ilTemplate('tpl.forums_export_print.html', true, true, 'Modules/Forum');
     $location_stylesheet = ilUtil::getStyleSheetLocation();
     $tpl->setVariable('LOCATION_STYLESHEET', $location_stylesheet);
     require_once 'Services/jQuery/classes/class.iljQueryUtil.php';
     iljQueryUtil::initjQuery();
     $this->frm->setMDB2WhereCondition('top_pk = %s ', array('integer'), array((int) $_GET['top_pk']));
     if (is_array($frmData = $this->frm->getOneTopic())) {
         $post = new ilForumPost((int) $_GET['print_post'], $this->is_moderator);
         $tpl->setVariable('TITLE', $post->getThread()->getSubject());
         $tpl->setVariable('HEADLINE', $lng->txt('forum') . ': ' . $frmData['top_name'] . ' > ' . $lng->txt('forums_thread') . ': ' . $post->getThread()->getSubject());
         $this->renderPostHtml($tpl, $post, 0, self::MODE_EXPORT_WEB);
     }
     $tpl->show();
 }