Exemplo n.º 1
0
 /**
  * @see \fpcm\controller\abstracts\controller::process()
  * @return mixed
  */
 public function process()
 {
     if (!parent::process()) {
         return false;
     }
     $this->view->assign('editorAction', 'articles/edit&articleid=' . $this->article->getId());
     $this->view->assign('editorMode', 1);
     $this->view->assign('showRevisions', true);
     $this->view->assign('postponedTimer', $this->article->getCreatetime());
     $this->view->assign('users', $this->userList->getUsersByIds(array($this->article->getCreateuser(), $this->article->getChangeuser())));
     $this->view->assign('commentCount', array_sum($this->commentList->countComments(array($this->article->getId()))));
     $this->view->assign('comments', $this->commentList->getCommentsByCondition($this->article->getId(), -1, -1, -1));
     $this->view->assign('commentsMode', 2);
     $revisions = $this->article->getRevisions();
     $this->view->assign('revisions', $revisions);
     $this->view->assign('revisionCount', count($revisions));
     $this->view->assign('revisionPermission', $this->permissions->check(array('article' => 'revisions')));
     $this->view->addJsVars(array('fpcmEditorCommentLayerSave' => $this->lang->translate('GLOBAL_SAVE'), 'fpcmCanConnect' => \fpcm\classes\baseconfig::canConnect() ? 1 : 0, 'fpcmNavigationActiveItemId' => 'itemnav-id-editnews'));
     $this->view->addJsLangVars(array('editorCommentLayerHeader' => $this->lang->translate('COMMENTS_EDIT')));
     if (!$this->permissions->check(array('article' => 'approve')) && $this->article->getApproval()) {
         $this->view->addMessage('Um den Artikel freizugeben, speichere ihn einfach erneut ab.');
     }
     $this->initPermissions();
     $this->view->assign('isRevision', false);
     if ($this->showRevision) {
         $this->view->assign('currentArticle', $this->currentArticle);
         $this->view->assign('editorFile', \fpcm\classes\baseconfig::$viewsDir . 'articles/editors/revisiondiff.php');
         $this->view->assign('isRevision', true);
         $this->view->assign('showRevisions', false);
         $this->view->assign('showComments', false);
         $this->view->assign('editorAction', 'articles/edit&articleid=' . $this->article->getId() . '&rev=' . $this->getRequestVar('rev'));
     }
     $this->view->render();
 }
Exemplo n.º 2
0
 /**
  * Kommentare parsen
  * @return string
  */
 protected function assignCommentsData()
 {
     if (!$this->config->system_comments_enabled || !$this->article->getComments()) {
         return '';
     }
     $comments = $this->commentList->getCommentsByCondition($this->articleId);
     $parsed = array();
     $i = 1;
     foreach ($comments as $comment) {
         $tpl = $this->commentTemplate;
         $replacements = array('{{author}}' => $comment->getName(), '{{email}}' => $comment->getEmail(), '{{website}}' => $comment->getWebsite(), '{{text}}' => $comment->getText(), '{{date}}' => date($this->config->system_dtmask, $comment->getCreatetime()), '{{number}}' => $i, '{{id}}' => $comment->getId(), '{{mentionid}}' => 'id="c' . $i . '"', '{{mention}}:{{/mention}}' => $i);
         $tpl->setReplacementTags($replacements);
         $parsed[] = $tpl->parse();
         $i++;
     }
     return implode(PHP_EOL, $parsed);
 }